Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(password-form): add better error handling #1128

Conversation

mdelez
Copy link
Collaborator

@mdelez mdelez commented Jul 3, 2023

resolves DEV-2244

@mdelez mdelez added the bug A bug fix label Jul 3, 2023
@mdelez mdelez self-assigned this Jul 3, 2023
@mdelez mdelez marked this pull request as ready for review July 3, 2023 12:10
Copy link
Contributor

@EricSommerhalder EricSommerhalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. How did the logout occur in the first place? was it nested in the error-handler somewhere?

@mdelez
Copy link
Collaborator Author

mdelez commented Jul 3, 2023

LGTM. How did the logout occur in the first place? was it nested in the error-handler somewhere?

this beautiful piece of code:

} else if (error.status === 401 && typeof error.error !== 'string') {
// logout if error status is a 401 error and comes from a DSP-JS request
this._dspApiConnection.v2.auth.logout().subscribe(
() => {
// destroy session
this._session.destroySession();
// reload the page
window.location.reload();
},
(logoutError: ApiResponseError) => {
this._notification.openSnackBar(logoutError);
throw new Error(logoutError.error['message']);
}

@mdelez mdelez merged commit e131a39 into main Jul 3, 2023
12 checks passed
@mdelez mdelez deleted the feature/dev-2244-if-you-change-another-users-password-you-get-logged-out branch July 3, 2023 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants