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

First-party auth doesn't return login errors #177

Closed
eatyourgreens opened this issue Nov 3, 2022 · 1 comment · Fixed by #178
Closed

First-party auth doesn't return login errors #177

eatyourgreens opened this issue Nov 3, 2022 · 1 comment · Fixed by #178
Labels

Comments

@eatyourgreens
Copy link
Contributor

Login errors aren't returned as rejected promises, which leads to them being handled as resolved promises with undefined arguments. See zooniverse/Panoptes-Front-End#6236

Compare the error handler for auth.signIn here:

.catch(function(request) {
console.error('Failed to sign in');
apiClient.handleError(request);
});

with the error handler for auth.register here:

.catch(function(request) {
console.error('Failed to register');
return apiClient.handleError(request);
});

@eatyourgreens eatyourgreens linked a pull request Nov 3, 2022 that will close this issue
@eatyourgreens
Copy link
Contributor Author

eatyourgreens commented Nov 3, 2022

I think this bug was introduced by #164. Prior to that change, calling apiClient.handleError(request) would have thrown an error in the login form. Now that handleError returns a rejected promise, that return value has to be returned from the catch block in auth.signIn in order to be passed along the promise chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant