Skip to content

Commit 5280aa4

Browse files
committed
eslint passing
1 parent e616c9d commit 5280aa4

File tree

13 files changed

+53
-80
lines changed

13 files changed

+53
-80
lines changed

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

lib/grant-types/authorization-code-grant-type.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ AuthorizationCodeGrantType.prototype.getAuthorizationCode = function(request, cl
133133
* @see https://tools.ietf.org/html/rfc6749#section-4.1.3
134134
*/
135135

136-
AuthorizationCodeGrantType.prototype.validateRedirectUri = function(request, code) {
137-
if (!code.redirectUri) {
138-
return;
139-
}
136+
AuthorizationCodeGrantType.prototype.validateRedirectUri = function(request, code) {
137+
if (!code.redirectUri) {
138+
return;
139+
}
140140

141-
var redirectUri = request.body.redirect_uri || request.query.redirect_uri;
141+
var redirectUri = request.body.redirect_uri || request.query.redirect_uri;
142142

143-
if (!is.uri(redirectUri)) {
144-
throw new InvalidRequestError('Invalid request: `redirect_uri` is not a valid URI');
145-
}
143+
if (!is.uri(redirectUri)) {
144+
throw new InvalidRequestError('Invalid request: `redirect_uri` is not a valid URI');
145+
}
146146

147-
if (redirectUri !== code.redirectUri) {
148-
throw new InvalidRequestError('Invalid request: `redirect_uri` is invalid');
149-
}
150-
};
147+
if (redirectUri !== code.redirectUri) {
148+
throw new InvalidRequestError('Invalid request: `redirect_uri` is invalid');
149+
}
150+
};
151151

152152
/**
153153
* Revoke the authorization code.

lib/handlers/authorize-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ AuthorizeHandler.prototype.handle = function(request, response) {
9797
var ResponseType;
9898

9999
return Promise.bind(this)
100-
.then(function() {
100+
.then(function() {
101101
scope = this.getScope(request);
102102

103103
return this.generateAuthorizationCode(client, user, scope);
104-
})
104+
})
105105
.then(function(authorizationCode) {
106106
state = this.getState(request);
107107
ResponseType = this.getResponseType(request);

test/integration/grant-types/abstract-grant-type_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('AbstractGrantType integration', function() {
6464

6565
return handler.generateAccessToken()
6666
.then(function(data) {
67-
data.should.be.a.sha1;
67+
data.should.be.a.sha1();
6868
})
6969
.catch(should.fail);
7070
});
@@ -98,7 +98,7 @@ describe('AbstractGrantType integration', function() {
9898

9999
return handler.generateRefreshToken()
100100
.then(function(data) {
101-
data.should.be.a.sha1;
101+
data.should.be.a.sha1();
102102
})
103103
.catch(should.fail);
104104
});

test/integration/handlers/authorize-handler_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ describe('AuthorizeHandler integration', function() {
499499

500500
return handler.generateAuthorizationCode()
501501
.then(function(data) {
502-
data.should.be.a.sha1;
502+
data.should.be.a.sha1();
503503
})
504504
.catch(should.fail);
505505
});
@@ -1036,10 +1036,10 @@ describe('AuthorizeHandler integration', function() {
10361036
describe('with `response_type` in the request body', function() {
10371037
it('should return a response type', function() {
10381038
var model = {
1039-
getAccessToken: function() {},
1040-
getClient: function() {},
1041-
saveAuthorizationCode: function() {}
1042-
};
1039+
getAccessToken: function() {},
1040+
getClient: function() {},
1041+
saveAuthorizationCode: function() {}
1042+
};
10431043
var handler = new AuthorizeHandler({ authorizationCodeLifetime: 120, model: model });
10441044
var request = new Request({ body: { response_type: 'code' }, headers: {}, method: {}, query: {} });
10451045
var ResponseType = handler.getResponseType(request);
@@ -1051,10 +1051,10 @@ describe('AuthorizeHandler integration', function() {
10511051
describe('with `response_type` in the request query', function() {
10521052
it('should return a response type', function() {
10531053
var model = {
1054-
getAccessToken: function() {},
1055-
getClient: function() {},
1056-
saveAuthorizationCode: function() {}
1057-
};
1054+
getAccessToken: function() {},
1055+
getClient: function() {},
1056+
saveAuthorizationCode: function() {}
1057+
};
10581058
var handler = new AuthorizeHandler({ authorizationCodeLifetime: 120, model: model });
10591059
var request = new Request({ body: {}, headers: {}, method: {}, query: { response_type: 'code' } });
10601060
var ResponseType = handler.getResponseType(request);

test/integration/handlers/token-handler_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ describe('TokenHandler integration', function() {
542542
requireClientAuthentication: {
543543
password: false
544544
}
545-
});
545+
});
546546
var request = new Request({ body: { client_id: 'blah', grant_type: 'password'}, headers: {}, method: {}, query: {} });
547547

548548
return handler.getClient(request)
@@ -569,13 +569,13 @@ describe('TokenHandler integration', function() {
569569
requireClientAuthentication: {
570570
password: false
571571
}
572-
});
572+
});
573573
var request = new Request({
574574
body: { grant_type: 'password'},
575575
headers: { 'authorization': util.format('Basic %s', new Buffer('blah:').toString('base64')) },
576576
method: {},
577577
query: {}
578-
});
578+
});
579579

580580
return handler.getClient(request)
581581
.then(function(data) {

test/integration/request_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Request integration', function() {
7676
it('should return `undefined` if the field does not exist', function() {
7777
var request = new Request({ body: {}, headers: {}, method: {}, query: {} });
7878

79-
(undefined === request.get('content-type')).should.be.true;
79+
(undefined === request.get('content-type')).should.be.true();
8080
});
8181

8282
it('should return the value if the field exists', function() {
@@ -147,13 +147,13 @@ describe('Request integration', function() {
147147
query: {}
148148
});
149149

150-
request.is('json').should.be.false;
150+
request.is('json').should.be.false();
151151
});
152152

153153
it('should return `false` if the request has no body', function() {
154154
var request = new Request({ body: {}, headers: {}, method: {}, query: {} });
155155

156-
request.is('text/html').should.be.false;
156+
request.is('text/html').should.be.false();
157157
});
158158
});
159159
});

test/integration/response_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Response integration', function() {
3535
it('should return `undefined` if the field does not exist', function() {
3636
var response = new Response({ body: {}, headers: {} });
3737

38-
(undefined === response.get('content-type')).should.be.true;
38+
(undefined === response.get('content-type')).should.be.true();
3939
});
4040

4141
it('should return the value if the field exists', function() {

test/integration/server_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ describe('Server integration', function() {
5252

5353
return server.authenticate(request, response)
5454
.then(function() {
55-
this.addAcceptedScopesHeader.should.be.true;
56-
this.addAuthorizedScopesHeader.should.be.true;
57-
this.allowBearerTokensInQueryString.should.be.false;
55+
this.addAcceptedScopesHeader.should.be.true();
56+
this.addAuthorizedScopesHeader.should.be.true();
57+
this.allowBearerTokensInQueryString.should.be.false();
5858
})
5959
.catch(should.fail);
6060
});
@@ -115,7 +115,7 @@ describe('Server integration', function() {
115115

116116
return server.authorize(request, response)
117117
.then(function() {
118-
this.allowEmptyState.should.be.false;
118+
this.allowEmptyState.should.be.false();
119119
this.authorizationCodeLifetime.should.equal(300);
120120
})
121121
.catch(should.fail);
@@ -225,7 +225,7 @@ describe('Server integration', function() {
225225
return { accessToken: 1234, client: {}, user: {} };
226226
},
227227
validateScope: function() {
228-
return 'foo';
228+
return 'foo';
229229
}
230230
};
231231
var server = new Server({ model: model });

0 commit comments

Comments
 (0)