diff --git a/src/app/accounts/two-factor.component.ts b/src/app/accounts/two-factor.component.ts index 02b2c4d80a9..9c7ca46f574 100644 --- a/src/app/accounts/two-factor.component.ts +++ b/src/app/accounts/two-factor.component.ts @@ -60,9 +60,12 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { } async goAfterLogIn() { - const invite = await this.stateService.get('orgInvitation'); - if (invite != null) { - this.router.navigate(['accept-organization'], { queryParams: invite }); + const orgInvite = await this.stateService.get('orgInvitation'); + const emergencyInvite = await this.stateService.get('emergencyInvitation'); + if (orgInvite != null) { + this.router.navigate(['accept-organization'], { queryParams: orgInvite }); + } else if (emergencyInvite != null) { + this.router.navigate(['accept-emergency'], { queryParams: emergencyInvite }); } else { const loginRedirect = await this.stateService.get('loginRedirect'); if (loginRedirect != null) {