Skip to content

Commit

Permalink
fix(ui): redirect mfa on home page (#6237)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored Jul 15, 2022
1 parent 5128364 commit 58687bc
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ui/src/app/service/authentication/error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ export class ErrorInterceptor implements HttpInterceptor {

if (e.error.message) {
// 194 is the error for "MFA required. See https://github.com/ovh/cds/blob/master/sdk/error.go#L205"
if (e.error.id === 194 && confirm(`${e.error.message}.\nDo you want to login using MFA ?`)) {
this._store.dispatch(new SignoutCurrentUser()).subscribe(() => {
this._router.navigate(['/auth/ask-signin/corporate-sso'], {
queryParams: {
redirect_uri: this.lastNavigatedURL,
require_mfa: true
}
if (e.error.id === 194) {
if (confirm(`${e.error.message}.\nDo you want to login using MFA ?`)) {
this._store.dispatch(new SignoutCurrentUser()).subscribe(() => {
this._router.navigate(['/auth/ask-signin/corporate-sso'], {
queryParams: {
redirect_uri: this.lastNavigatedURL,
require_mfa: true
}
});
});
});
} else {
this._router.navigate(['/home']);
}
return observableThrowError(e);
}
this._toast.errorHTTP(e.status, e.error.message, e.error.from, e.error.request_id);
this._router.navigate(['/home']);
return observableThrowError(e);
}

Expand Down

0 comments on commit 58687bc

Please sign in to comment.