Allow access token in URI (#3208)

th-downstream
happycoloredbanana 8 years ago committed by Eugen Rochko
parent 0dfe09d630
commit cb68926ebf

@ -199,8 +199,9 @@ if (cluster.isMaster) {
}
const authorization = req.get('Authorization');
const accessToken = req.query.access_token;
if (!authorization) {
if (!authorization && !accessToken) {
const err = new Error('Missing access token');
err.statusCode = 401;
@ -208,7 +209,7 @@ if (cluster.isMaster) {
return;
}
const token = authorization.replace(/^Bearer /, '');
const token = authorization ? authorization.replace(/^Bearer /, '') : accessToken;
accountFromToken(token, req, next);
};

Loading…
Cancel
Save