mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
store token in cookie instead of authorization header
This commit is contained in:
parent
ac43549496
commit
b698029972
2 changed files with 5 additions and 6 deletions
|
|
@ -511,8 +511,8 @@ export const enqueueThumbnailTask = async (
|
|||
content,
|
||||
}
|
||||
|
||||
const requestHeaders = {
|
||||
Authorization: generateVerificationToken(userId),
|
||||
const headers = {
|
||||
Cookie: `auth=${generateVerificationToken(userId)}`,
|
||||
}
|
||||
|
||||
// If there is no Google Cloud Project Id exposed, it means that we are in local environment
|
||||
|
|
@ -521,7 +521,7 @@ export const enqueueThumbnailTask = async (
|
|||
setTimeout(() => {
|
||||
axios
|
||||
.post(env.queue.thumbnailTaskHandlerUrl, payload, {
|
||||
headers: requestHeaders,
|
||||
headers,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
|
|
@ -533,7 +533,7 @@ export const enqueueThumbnailTask = async (
|
|||
const createdTasks = await createHttpTaskWithToken({
|
||||
payload,
|
||||
taskHandlerUrl: env.queue.thumbnailTaskHandlerUrl,
|
||||
requestHeaders,
|
||||
requestHeaders: headers,
|
||||
})
|
||||
|
||||
if (!createdTasks || !createdTasks[0].name) {
|
||||
|
|
|
|||
|
|
@ -233,8 +233,7 @@ export const thumbnailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
return res.status(500).send('JWT_SECRET_NOT_EXISTS')
|
||||
}
|
||||
|
||||
const token = req.headers?.authorization
|
||||
console.debug('token', token)
|
||||
const token = req.headers.cookie?.split('auth=')[1]
|
||||
if (!token) {
|
||||
console.debug('no token')
|
||||
return res.status(401).send('UNAUTHORIZED')
|
||||
|
|
|
|||
Loading…
Reference in a new issue