Merge pull request #5355 from FinnStutzenstein/SamlInfitySpinnerFix

fixed endless spinner on SAML login
This commit is contained in:
Emanuel Schütze 2020-05-06 19:20:28 +02:00 committed by GitHub
commit ea830f53b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.