fix: importer status update email not sent

* create omnivore-authorization header to contain the token
This commit is contained in:
Hongbo Wu
2023-06-28 11:00:40 +08:00
parent f4d9821fdd
commit af7350bd31
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -124,7 +124,7 @@ const createEmailCloudTask = async (userId: string, payload: unknown) => {
process.env.JWT_SECRET
)) as string
const headers = {
Cookie: `auth=${authToken}`,
'Omnivore-Authorization': authToken,
}
return createCloudTask(