diff --git a/npm/ng-packs/packages/core/src/lib/services/auth.service.ts b/npm/ng-packs/packages/core/src/lib/services/auth.service.ts index 0c38b22acf..35f667bf20 100644 --- a/npm/ng-packs/packages/core/src/lib/services/auth.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/auth.service.ts @@ -20,14 +20,14 @@ export class AuthService { private oAuthService: OAuthService, private store: Store, @Optional() @Inject('ACCOUNT_OPTIONS') private options: any, - ) {} - - login(username: string, password: string): Observable { - const tenant = this.store.selectSnapshot(SessionState.getTenant); - + ) { this.oAuthService.configure( this.store.selectSnapshot(ConfigState.getOne('environment')).oAuthConfig, ); + } + + login(username: string, password: string): Observable { + const tenant = this.store.selectSnapshot(SessionState.getTenant); return from(this.oAuthService.loadDiscoveryDocument()).pipe( switchMap(() => @@ -63,7 +63,7 @@ export class AuthService { ) .pipe( switchMap(() => { - this.oAuthService.logOut(); + this.oAuthService.logOut(true); return this.store.dispatch(new GetAppConfiguration()); }), );