-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure self-hosted instance can use SendGrid (#318)
- Loading branch information
1 parent
0c11b7e
commit 94a5a6d
Showing
16 changed files
with
64 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,10 +77,16 @@ async function isLicencedBase(): Promise<LicenceMetadata | null> { | |
const result = (await response.json()) as LicenceMetadata; | ||
return result; | ||
} else { | ||
console.error( | ||
'Could not contact the licence server. If you have a valid licence, please contact [email protected] for support.' | ||
); | ||
console.log(response.status, response.statusText); | ||
if (response.status === 403) { | ||
console.error( | ||
'The licence key is not recognised. If you have a valid licence, please contact [email protected] for support.' | ||
); | ||
} else { | ||
console.error( | ||
'Could not contact the licence server. If you have a valid licence, please contact [email protected] for support.' | ||
); | ||
console.log(response.status, response.statusText); | ||
} | ||
} | ||
} catch (err) { | ||
console.error( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
import { atom } from 'recoil'; | ||
import { OAuthAvailabilities } from '@retrospected/common'; | ||
import { BackendCapabilities } from '@retrospected/common'; | ||
|
||
export const adminEmailState = atom<string | null>({ | ||
key: 'ADMIN_EMAIL', | ||
default: null, | ||
}); | ||
export const isLicencedState = atom<boolean>({ | ||
key: 'LICENCED', | ||
default: true, | ||
}); | ||
export const selfHostedState = atom<boolean>({ | ||
key: 'SELF-HOSTED', | ||
default: false, | ||
}); | ||
export const oauthAvailabilitiesState = atom<OAuthAvailabilities>({ | ||
key: 'OAuthAvailabilities', | ||
export const backendCapabilitiesState = atom<BackendCapabilities>({ | ||
key: 'BACKEND_CAPABILITIES', | ||
default: { | ||
google: false, | ||
github: false, | ||
twitter: false, | ||
microsoft: false, | ||
slack: false, | ||
okta: false, | ||
adminEmail: '', | ||
licenced: true, | ||
selfHosted: false, | ||
oAuth: { | ||
google: false, | ||
github: false, | ||
twitter: false, | ||
microsoft: false, | ||
slack: false, | ||
okta: false, | ||
}, | ||
sendGridAvailable: false, | ||
}, | ||
}); | ||
export const isSendGridAvailableState = atom<boolean>({ | ||
key: 'SENDGRID_AVAILABLE', | ||
default: false, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BackendCapabilities } from '@retrospected/common'; | ||
import { useRecoilValue } from 'recoil'; | ||
import { backendCapabilitiesState } from './state'; | ||
|
||
export default function useBackendCapabilities(): BackendCapabilities { | ||
return useRecoilValue(backendCapabilitiesState); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters