Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Commit

Permalink
Fixed error message when unauthorized google user tries to login
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Apr 25, 2016
1 parent 15c05cc commit da81588
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions routes/30-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,16 @@ module.exports = function(app, config) {
var userKey = 'org.couchdb.user:' + profile.emails[0].value;
users.get(userKey, {}, function(err, body) {
if (err) {
if (err.status_code === 404) {
callback();
if (err.error && err.error === 'not_found') {
callback(null, false);
} else {
callback(err);
}
return;
}
if (body.deleted) {
callback();
callback(null, false);
return;
}
if (validateOAuth(body.oauth)) {
return callback(null, denormalizeOAuth(body));
Expand Down

0 comments on commit da81588

Please sign in to comment.