mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 10:38:07 +01:00
Allow access token in URI (#3208)
This commit is contained in:
parent
a4c757767f
commit
7fba4cb3d1
1 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue