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

Insufficient Error Handling in usePasswordGrant(done) #206

Closed
roschumacher opened this issue Aug 12, 2015 · 1 comment
Closed

Insufficient Error Handling in usePasswordGrant(done) #206

roschumacher opened this issue Aug 12, 2015 · 1 comment

Comments

@roschumacher
Copy link

In grant.js within the usePasswordGrant Method you do

return this.model.getUser(uname, pword, function (err, user) {
    if (err) return done(error('server_error', false, err));

That means, independently of err a server_error is returned. Here for example should be checked, if err is of type OAuth2Error in order to handle the error respectively.

Why do i have this problem: In my implementation of the authenticate method, i check if the user trying to log in has already confirmed his email address. If not, i pass an respective error. Unfortunately, the error get's not returned by the server because of the problem stated above.

In general, can I somehow extend the error types specified in error.js?

@thomseddon
Copy link
Member

This is a valid request - it would be good to be able to extend the module and throw your own errors, this isn't something that's currently supported.

This has been propsoed in #115 - I'm going to close and we can track in there?

Please reopen if that doesn't hit the spot!

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

No branches or pull requests

2 participants