1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 19:23:52 +00:00

Refactor accept-organization and accept-emergency (#1026)

This commit is contained in:
Oscar Hinton
2021-06-15 21:02:04 +02:00
committed by GitHub
parent b8aff13ce2
commit 14e9784297
5 changed files with 195 additions and 191 deletions

View File

@@ -76,20 +76,12 @@ export class LoginComponent extends BaseLoginComponent {
}
async goAfterLogIn() {
const orgInvite = await this.stateService.get<any>('orgInvitation');
const emergencyInvite = await this.stateService.get<any>('emergencyInvitation');
if (orgInvite != null) {
this.router.navigate(['accept-organization'], { queryParams: orgInvite });
} else if (emergencyInvite != null) {
this.router.navigate(['accept-emergency'], { queryParams: emergencyInvite });
const loginRedirect = await this.stateService.get<any>('loginRedirect');
if (loginRedirect != null) {
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
await this.stateService.remove('loginRedirect');
} else {
const loginRedirect = await this.stateService.get<any>('loginRedirect');
if (loginRedirect != null) {
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
await this.stateService.remove('loginRedirect');
} else {
this.router.navigate([this.successRoute]);
}
this.router.navigate([this.successRoute]);
}
}
}