Merge pull request #1621 from omnivore-app/fix/get-auth-token-from-cookie

Get the auth token from cookie in the user_router
This commit is contained in:
Jackson Harper 2023-01-06 11:18:01 +08:00 committed by GitHub
commit ddda9de85b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ export function userRouter() {
router.post('/email', cors<express.Request>(corsConfig), async (req, res) => {
logger.info('email to-user router')
const token = req?.headers?.authorization
const token = req?.cookies?.auth || req?.headers?.authorization
const claims = await getClaimsByToken(token)
if (!claims) {
res.status(401).send('UNAUTHORIZED')