fixed endless spinner on SAML login

This commit is contained in:
FinnStutzenstein 2020-05-06 18:23:38 +02:00
parent 1e2395c1e6
commit c643a233ae
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
2 changed files with 8 additions and 1 deletions

View File

@ -56,6 +56,9 @@ export class AuthService {
await this.OpenSlides.afterLoginBootup(response.user_id); await this.OpenSlides.afterLoginBootup(response.user_id);
await this.redirectUser(response.user_id); await this.redirectUser(response.user_id);
} else if (authType === 'saml') { } else if (authType === 'saml') {
await this.operator.clearWhoAmIFromStorage(); // This is important:
// Then returning to the page, we do not want to have anything cached so a
// fresh whoami is executed.
window.location.href = environment.urlPrefix + '/saml/?sso'; // Bye window.location.href = environment.urlPrefix + '/saml/?sso'; // Bye
} else { } else {
throw new Error(`Unsupported auth type "${authType}"`); throw new Error(`Unsupported auth type "${authType}"`);
@ -67,7 +70,7 @@ export class AuthService {
* if it wasn't done before. * if it wasn't done before.
*/ */
public async redirectUser(userId: number): Promise<void> { public async redirectUser(userId: number): Promise<void> {
if (!this.OpenSlides.booted) { if (!this.OpenSlides.isBooted) {
await this.OpenSlides.afterLoginBootup(userId); await this.OpenSlides.afterLoginBootup(userId);
} }

View File

@ -252,6 +252,10 @@ export class OperatorService implements OnAfterAppsLoaded {
return response; return response;
} }
public async clearWhoAmIFromStorage(): Promise<void> {
await this.storageService.remove(WHOAMI_STORAGE_KEY);
}
/** /**
* Sets the operator user. Will be saved to storage * Sets the operator user. Will be saved to storage
* @param user The new operator. * @param user The new operator.