mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
chore: update config key to match others
This commit is contained in:
parent
4cfb22a2c8
commit
9ce1caccce
3 changed files with 7 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ export class AppConfig {
|
|||
allowedCookieDomains: [],
|
||||
skipCookieDomainSecurity: false,
|
||||
enableSingleSignOn: false,
|
||||
enableSingleSignOnSignUp: false,
|
||||
allowSingleSignOnSignups: false,
|
||||
singleSignOnUrl: '',
|
||||
singleSignOnEmailAttribute: 'email',
|
||||
singleSignOnScopes: ['openid', 'email'],
|
||||
|
|
@ -121,7 +121,7 @@ export class AppConfig {
|
|||
static async isSignupAllowed(sso: boolean = false): Promise<boolean> {
|
||||
await this.loadConfig();
|
||||
|
||||
const areSignupsAllowed = sso ? this.config.auth.enableSingleSignOnSignUp : this.config.auth.allowSignups;
|
||||
const areSignupsAllowed = sso ? this.config.auth.allowSingleSignOnSignups : this.config.auth.allowSignups;
|
||||
const areThereAdmins = await UserModel.isThereAnAdmin();
|
||||
|
||||
return areSignupsAllowed || !areThereAdmins;
|
||||
|
|
|
|||
|
|
@ -182,9 +182,10 @@ export class OidcModel {
|
|||
|
||||
if (!user) {
|
||||
// this will allow admin account creation even if SSO signups are disabled following the foregoing logic
|
||||
if (!config.auth.enableSingleSignOnSignUp) {
|
||||
throw new Error('Sign up via SSO is not enabled');
|
||||
if (!config.auth.allowSingleSignOnSignups) {
|
||||
throw new Error('Sign up via SSO is not allowed');
|
||||
}
|
||||
|
||||
throw new Error('There was a problem signing up or logging in!');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,8 +159,8 @@ export interface Config {
|
|||
skipCookieDomainSecurity: boolean;
|
||||
/** If true, single sign-on will be enabled */
|
||||
enableSingleSignOn: boolean;
|
||||
/** If true, single sign-on signups will be enabled overriding allowSignups */
|
||||
enableSingleSignOnSignUp: boolean;
|
||||
/** If true, single sign-on signups will be allowed overriding allowSignups */
|
||||
allowSingleSignOnSignups: boolean;
|
||||
/** The Discovery URL (AKA Issuer) of the identity/single sign-on provider */
|
||||
singleSignOnUrl: string;
|
||||
/** The attribute to prefer as email of the identity/single sign-on provider */
|
||||
|
|
|
|||
Loading…
Reference in a new issue