Browse Source
Merge pull request #2074 from Budibase/fix/oidc-fixes
Fix/oidc fixes
gh-pages
Rory Powell
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
1 deletions
-
packages/builder/src/pages/builder/portal/manage/auth/index.svelte
-
packages/worker/src/api/controllers/admin/auth.js
|
|
|
@ -217,6 +217,10 @@ |
|
|
|
} |
|
|
|
originalGoogleDoc = cloneDeep(googleDoc) |
|
|
|
} else { |
|
|
|
// default activated to true for older configs |
|
|
|
if (googleDoc.config.activated === undefined) { |
|
|
|
googleDoc.config.activated = true |
|
|
|
} |
|
|
|
originalGoogleDoc = cloneDeep(googleDoc) |
|
|
|
providers.google = googleDoc |
|
|
|
} |
|
|
|
|
|
|
|
@ -144,7 +144,9 @@ async function oidcStrategyFactory(ctx, configId) { |
|
|
|
|
|
|
|
const chosenConfig = config.configs.filter(c => c.uuid === configId)[0] |
|
|
|
|
|
|
|
const callbackUrl = `${ctx.protocol}://${ctx.host}/api/admin/auth/oidc/callback` |
|
|
|
// require https callback in production
|
|
|
|
const protocol = process.env.NODE_ENV === "production" ? "https" : "http" |
|
|
|
const callbackUrl = `${protocol}://${ctx.host}/api/admin/auth/oidc/callback` |
|
|
|
|
|
|
|
return oidc.strategyFactory(chosenConfig, callbackUrl) |
|
|
|
} |
|
|
|
|