Skip to content

Commit e13b758

Browse files
committed
fix
1 parent 845534d commit e13b758

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/middleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ var checkAuthToken = function (authToken) {
3535
var checkAccessToken = function (accessToken) {
3636
return new Promise((resolve, reject) => {
3737
if (_.isEmpty(accessToken)) {
38-
reject(new AppError.Unauthorized());
38+
return reject(new AppError.Unauthorized());
3939
}
4040
var config = require('../core/config');
4141
var tokenSecret = _.get(config, 'jwt.tokenSecret');
4242
var jwt = require('jsonwebtoken');
4343
try {
4444
var authData = jwt.verify(accessToken, tokenSecret);
4545
} catch (e) {
46-
reject(new AppError.Unauthorized());
46+
return reject(new AppError.Unauthorized());
4747
}
4848
var uid = _.get(authData, 'uid', null);
4949
var hash = _.get(authData, 'hash', null);

0 commit comments

Comments
 (0)