Skip to content

Commit

Permalink
Use cookie in request if present
Browse files Browse the repository at this point in the history
  • Loading branch information
hdiniz committed Nov 27, 2024
1 parent 91f5b4f commit 994d54c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/middleware/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import RateLimit from '../lib/rate-limit';
import { clearRedirectCookie, setRedirectCookie } from '../lib/redirect-cookie';
import { reportMessageToSentry } from '../lib/sentry';
import { TWITTER_SCOPES } from '../lib/twitter';
import { getBearerTokenFromRequestHeaders, parseToBoolean } from '../lib/utils';
import { getBearerTokenFromCookie, getBearerTokenFromRequestHeaders, parseToBoolean } from '../lib/utils';
import models from '../models';
import paymentProviders from '../paymentProviders';

Expand Down Expand Up @@ -47,7 +47,7 @@ const debug = debugLib('auth');
const parseJwt = req => {
let token = req.params.access_token || req.query.access_token || req.body.access_token;
if (!token) {
token = getBearerTokenFromRequestHeaders(req);
token = getBearerTokenFromRequestHeaders(req) || getBearerTokenFromCookie(req);
}

if (token) {
Expand Down

0 comments on commit 994d54c

Please sign in to comment.