Skip to content

Commit f5d0515

Browse files
author
Thom Seddon
committed
JSHint cleanups
1 parent 69a667c commit f5d0515

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

.jshintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

lib/authorise.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ authorise.getBearerToken = function (req, next) {
7878
postToken = req.body.access_token;
7979

8080
// Check exactly one method was used
81-
var methodsUsed = (typeof headerToken !== 'undefined') + (typeof getToken !== 'undefined')
82-
+ (typeof postToken !== 'undefined');
81+
var methodsUsed = (headerToken !== undefined) + (getToken !== undefined) +
82+
(postToken !== undefined);
8383

8484
if (methodsUsed > 1) {
8585
return next(new OAuth2Error('invalid_request',

lib/oauth2server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function OAuth2Server (config) {
5050
this.regex = {};
5151
this.regex.clientId = config.clientIdRegex || /^[a-z0-9-_]{3,40}$/i;
5252
this.regex.grantType = new RegExp('^(' + this.grants.join('|') + ')$', 'i');
53-
};
53+
}
5454

5555
/**
5656
* Authorise incoming requests
@@ -74,7 +74,7 @@ OAuth2Server.prototype.handler = function () {
7474
if (allowed instanceof Array) {
7575
allow = allowed;
7676
} else {
77-
allow = allow.concat(allowed['all'] || []);
77+
allow = allow.concat(allowed.all || []);
7878
allow = allow.concat(allowed[req.method.toLowerCase()] || []);
7979
}
8080

@@ -88,7 +88,7 @@ OAuth2Server.prototype.handler = function () {
8888
} else {
8989
return next();
9090
}
91-
}
91+
};
9292
};
9393

9494
/**
@@ -113,5 +113,5 @@ OAuth2Server.prototype.errorHandler = function () {
113113
delete err.stack;
114114

115115
res.send(err.code, err);
116-
}
116+
};
117117
};

lib/token.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ token.grant = function (req, res, next) {
124124
if (!supported) return invalid();
125125

126126
if (!user || user.id === undefined) {
127-
return next(new OAuth2Error('invalid_request', 'Invalid request.'))
127+
return next(new OAuth2Error('invalid_request', 'Invalid request.'));
128128
}
129129

130130
req.user = user;

test/oauth2server.handle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('OAuth2Server.handle()', function() {
6565
.expect(400)
6666
.end(function (err, res) {
6767
if (err) return done(err);
68-
res.body.error_description.should.not.match(/the access token was not found/i)
68+
res.body.error_description.should.not.match(/the access token was not found/i);
6969
done();
7070
});
7171
});

0 commit comments

Comments
 (0)