chore: update config key to match others

This commit is contained in:
Piotr Łoboda 2026-02-25 17:53:39 +01:00
parent 4cfb22a2c8
commit 9ce1caccce
3 changed files with 7 additions and 6 deletions

View file

@ -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;

View file

@ -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!');
}

View file

@ -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 */