diff --git a/projects/auth-js/oidc/models/oidc-auth-settings.model.ts b/projects/auth-js/oidc/models/oidc-auth-settings.model.ts index c84a9ae..c7cf231 100644 --- a/projects/auth-js/oidc/models/oidc-auth-settings.model.ts +++ b/projects/auth-js/oidc/models/oidc-auth-settings.model.ts @@ -14,7 +14,7 @@ export interface OIDCAuthSettings extends CoreAuthSettings, Pick>; diff --git a/projects/auth-js/oidc/oidc-auth-manager.ts b/projects/auth-js/oidc/oidc-auth-manager.ts index ec0d318..3d0e14a 100644 --- a/projects/auth-js/oidc/oidc-auth-manager.ts +++ b/projects/auth-js/oidc/oidc-auth-manager.ts @@ -18,7 +18,7 @@ const REDIRECT_URL_KEY = 'auth-js:oidc_manager:redirect_url'; const DEFAULT_SETTINGS: Optional = { loginRequired: false, - loadSession: true, + loadUserSession: true, loadUserInfo: false, automaticSilentRenew: true, navigationType: Navigation.REDIRECT, @@ -152,7 +152,7 @@ export class OIDCAuthManager extends AuthManager { await runSyncOrAsync(() => this.backFromLogin()); } else if (this.urlMatching(location.href, this.settings.internal?.post_logout_redirect_uri)) { await runSyncOrAsync(() => this.backFromLogout()); - } else if (this.settings.loadSession) { + } else if (this.settings.loadUserSession) { await runSyncOrAsync(() => this.signinSilent().catch(async (signinSilentError: Error) => { if (this.settings.loginRequired) { if (signinSilentError.message === 'login_required') { diff --git a/projects/demo-app/auth-js/src/app/app.settings.ts b/projects/demo-app/auth-js/src/app/app.settings.ts index a9090f1..a129442 100644 --- a/projects/demo-app/auth-js/src/app/app.settings.ts +++ b/projects/demo-app/auth-js/src/app/app.settings.ts @@ -18,7 +18,7 @@ const settings: Settings[] = [{ navigationType: Navigation.REDIRECT, logLevel: Log.NONE, loginRequired: false, - loadSession: true, + loadUserSession: true, loadUserInfo: true, automaticSilentRenew: true } @@ -32,7 +32,7 @@ const settings: Settings[] = [{ navigationType: Navigation.REDIRECT, logLevel: Log.NONE, loginRequired: false, - loadSession: true, + loadUserSession: true, loadUserInfo: true, automaticSilentRenew: true } @@ -98,12 +98,12 @@ const librarySettingsDefinition: LibrarySettingsDefinitionItem label: 'Login required', type: 'boolean' }, { - name: 'loadSession', - label: 'Load session', + name: 'loadUserSession', + label: 'Load user\'s session', type: 'boolean' }, { name: 'loadUserInfo', - label: 'Load user info', + label: 'Load user\'s info', type: 'boolean' }, { name: 'automaticSilentRenew', diff --git a/projects/demo-app/ngx-auth/src/app/app.settings.ts b/projects/demo-app/ngx-auth/src/app/app.settings.ts index 5fa0d58..43e388b 100644 --- a/projects/demo-app/ngx-auth/src/app/app.settings.ts +++ b/projects/demo-app/ngx-auth/src/app/app.settings.ts @@ -25,7 +25,7 @@ const settings: Settings[] = [{ navigationType: Navigation.REDIRECT, logLevel: Log.NONE, loginRequired: false, - loadSession: true, + loadUserSession: true, loadUserInfo: true, automaticSilentRenew: true, automaticLoginOn401: true, @@ -47,7 +47,7 @@ const settings: Settings[] = [{ navigationType: Navigation.REDIRECT, logLevel: Log.NONE, loginRequired: false, - loadSession: true, + loadUserSession: true, loadUserInfo: true, automaticSilentRenew: true, automaticLoginOn401: true, @@ -119,12 +119,12 @@ const librarySettingsDefinition: LibrarySettingsDefinitionItem[] = label: 'Login required', type: 'boolean' }, { - name: 'loadSession', - label: 'Load session', + name: 'loadUserSession', + label: 'Load user\'s session', type: 'boolean' }, { name: 'loadUserInfo', - label: 'Load user info', + label: 'Load user\'s info', type: 'boolean' }, { name: 'automaticSilentRenew', diff --git a/projects/ngx-auth/schematics/install/index.ts b/projects/ngx-auth/schematics/install/index.ts index 7bbf082..f6bb6b3 100644 --- a/projects/ngx-auth/schematics/install/index.ts +++ b/projects/ngx-auth/schematics/install/index.ts @@ -17,7 +17,7 @@ const getActualUserConfig = async (context: SchematicContext, options: InstallOp authorityUrl: options.authorityUrl, clientId: options.clientId }; - (['loginRequired', 'loadSession', 'loadUserInfo'] as (keyof InstallOptions)[]).forEach(name => { + (['loginRequired', 'loadUserSession', 'loadUserInfo'] as (keyof InstallOptions)[]).forEach(name => { if (options[name] !== defaultOptions[name]) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any (config as any)[name] = options[name]; diff --git a/projects/ngx-auth/schematics/install/install-options.ts b/projects/ngx-auth/schematics/install/install-options.ts index f2849df..4c20e1c 100644 --- a/projects/ngx-auth/schematics/install/install-options.ts +++ b/projects/ngx-auth/schematics/install/install-options.ts @@ -3,6 +3,6 @@ export class InstallOptions { public authorityUrl!: string; public clientId!: string; public loginRequired?: boolean; - public loadSession?: boolean; + public loadUserSession?: boolean; public loadUserInfo?: boolean; } diff --git a/projects/ngx-auth/schematics/install/schema.json b/projects/ngx-auth/schematics/install/schema.json index 4bc56b6..ef45fe9 100644 --- a/projects/ngx-auth/schematics/install/schema.json +++ b/projects/ngx-auth/schematics/install/schema.json @@ -26,7 +26,7 @@ "type": "boolean", "default": false }, - "loadSession": { + "loadUserSession": { "x-prompt": "Retrieve user's session at startup ?", "description": "Whether any currently opened user's session should be retrieved during the initialization phase.", "type": "boolean", diff --git a/projects/site/docs/docs/configuration.mdx b/projects/site/docs/docs/configuration.mdx index 340d604..2392e7f 100644 --- a/projects/site/docs/docs/configuration.mdx +++ b/projects/site/docs/docs/configuration.mdx @@ -46,7 +46,7 @@ await initAuth(settings: AuthSettings); > **type**: boolean
> **default**: true -### `loadSession` +### `loadUserSession` > **type**: boolean
> **default**: true