1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

cleanup various sso tasks (#617)

This commit is contained in:
Kyle Spearrin
2020-08-20 16:39:05 -04:00
committed by GitHub
parent b2685d455b
commit 56e92b1695
9 changed files with 47 additions and 14 deletions

View File

@@ -15,6 +15,8 @@ import { StorageService } from 'jslib/abstractions/storage.service';
import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component';
const IdentifierStorageKey = 'ssoOrgIdentifier';
@Component({
selector: 'app-sso',
templateUrl: 'sso.component.html',
@@ -31,4 +33,26 @@ export class SsoComponent extends BaseSsoComponent {
this.redirectUri = window.location.origin + '/sso-connector.html';
this.clientId = 'web';
}
async ngOnInit() {
super.ngOnInit();
const queryParamsSub = this.route.queryParams.subscribe(async (qParams) => {
if (qParams.identifier != null) {
this.identifier = qParams.identifier;
} else {
const storedIdentifier = await this.storageService.get<string>(IdentifierStorageKey);
if (storedIdentifier != null) {
this.identifier = storedIdentifier;
}
}
if (queryParamsSub != null) {
queryParamsSub.unsubscribe();
}
});
}
async submit() {
await this.storageService.save(IdentifierStorageKey, this.identifier);
super.submit();
}
}