fix: importer status update email not sent
* create omnivore-authorization header to contain the token
This commit is contained in:
@ -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')
|
||||
|
||||
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user