Neon / portal template support (#713)
TODOs: - [x] Do restart when checkout / restore if there is a DB - [x] List all branches (branch id, name, date) - [x] Allow checking out versions with no DB - [x] safeguard to never delete main branches - [x] create app hook for neon template - [x] weird UX with connector on configure panel - [x] tiny neon logo in connector - [x] deploy to vercel - [x] build forgot password page - [x] what about email setup - [x] lots of imgix errors - [x] edit file - db snapshot - [x] DYAD_DISABLE_DB_PUSH - [ ] update portal doc - [x] switch preview branch to be read-only endpoint - [x] disable supabase sys prompt if neon is enabled - [ ] https://payloadcms.com/docs/upload/storage-adapters - [x] need to use main branch... Phase 2? - [x] generate DB migrations
This commit is contained in:
@@ -69,6 +69,27 @@ export function readSettings(): UserSettings {
|
||||
}
|
||||
}
|
||||
}
|
||||
const neon = combinedSettings.neon;
|
||||
if (neon) {
|
||||
if (neon.refreshToken) {
|
||||
const encryptionType = neon.refreshToken.encryptionType;
|
||||
if (encryptionType) {
|
||||
neon.refreshToken = {
|
||||
value: decrypt(neon.refreshToken),
|
||||
encryptionType,
|
||||
};
|
||||
}
|
||||
}
|
||||
if (neon.accessToken) {
|
||||
const encryptionType = neon.accessToken.encryptionType;
|
||||
if (encryptionType) {
|
||||
neon.accessToken = {
|
||||
value: decrypt(neon.accessToken),
|
||||
encryptionType,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
if (combinedSettings.githubAccessToken) {
|
||||
const encryptionType = combinedSettings.githubAccessToken.encryptionType;
|
||||
combinedSettings.githubAccessToken = {
|
||||
@@ -131,6 +152,18 @@ export function writeSettings(settings: Partial<UserSettings>): void {
|
||||
);
|
||||
}
|
||||
}
|
||||
if (newSettings.neon) {
|
||||
if (newSettings.neon.accessToken) {
|
||||
newSettings.neon.accessToken = encrypt(
|
||||
newSettings.neon.accessToken.value,
|
||||
);
|
||||
}
|
||||
if (newSettings.neon.refreshToken) {
|
||||
newSettings.neon.refreshToken = encrypt(
|
||||
newSettings.neon.refreshToken.value,
|
||||
);
|
||||
}
|
||||
}
|
||||
for (const provider in newSettings.providerSettings) {
|
||||
if (newSettings.providerSettings[provider].apiKey) {
|
||||
newSettings.providerSettings[provider].apiKey = encrypt(
|
||||
|
||||
Reference in New Issue
Block a user