Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added checking for 'error' query string parameter in github callback #74

Merged
merged 1 commit into from

2 participants

@joelrbrandt

When a user denies authorization using github, github makes a callback of the form:

http://myapp.com/auth/github_callback?error=user_denied

I added checking for this error query string to the github strategy.

Thanks for this great library!

@ciaranj ciaranj merged commit e143d9c into ciaranj:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/auth.strategies/github.js
View
4 lib/auth.strategies/github.js
@@ -69,6 +69,10 @@ module.exports= function(options, server) {
}
});
}
+ else if( parsedUrl.query && parsedUrl.query.error ) {
+ request.getAuthDetails()['github_login_attempt_failed'] = true;
+ self.fail(callback);
+ }
else {
request.session['github_redirect_url']= request.url;
var redirectUrl= my._oAuth.getAuthorizeUrl({redirect_uri : my._redirectUri, scope: my.scope })
Something went wrong with that request. Please try again.