Created
January 22, 2020 06:16
-
-
Save hadoan/830e1e1cf5c7d9a71e2cce5a071da97a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private processAuthenticateResult(authenticateResult: AuthenticateResultModel, redirectUrl?: string) { | |
this.authenticateResult = authenticateResult; | |
if (authenticateResult.shouldResetPassword) { | |
// Password reset | |
this._router.navigate(['account/reset-password'], { | |
queryParams: { | |
userId: authenticateResult.userId, | |
tenantId: abp.session.tenantId, | |
resetCode: authenticateResult.passwordResetCode | |
} | |
}); | |
this.clear(); | |
} else if (authenticateResult.requiresTwoFactorVerification) { | |
// Two factor authentication | |
this._router.navigate(['account/send-code']); | |
} else if (authenticateResult.accessToken) { | |
// Successfully logged in | |
if (authenticateResult.returnUrl && !redirectUrl) { | |
redirectUrl = authenticateResult.returnUrl; | |
} | |
this.login( | |
authenticateResult.accessToken, | |
authenticateResult.encryptedAccessToken, | |
authenticateResult.expireInSeconds, | |
authenticateResult.refreshToken, | |
authenticateResult.refreshTokenExpireInSeconds, | |
this.rememberMe, | |
authenticateResult.twoFactorRememberClientToken, | |
redirectUrl | |
); | |
} else { | |
// Unexpected result! | |
this._logService.warn('Unexpected authenticateResult!'); | |
this._router.navigate(['account/login']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment