Merge pull request #58 from omnivore-app/fix/upgrade-axios

Handle upgraded axios API for headers
This commit is contained in:
Jackson Harper 2022-02-15 08:11:09 +08:00 committed by GitHub
commit 5724364be0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -275,6 +275,15 @@ export function authRouter() {
)
}
if (!result.headers['set-cookie']) {
return res.redirect(
`${env.client.url}/${
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(req.params as any)?.action
}?errorCodes=unknown`
)
}
res.setHeader('set-cookie', result.headers['set-cookie'])
handleSuccessfulLogin(req, res, user, data.googleLogin.newUser)
@ -384,6 +393,15 @@ export function authRouter() {
)
}
if (!result.headers['set-cookie']) {
return res.redirect(
`${env.client.url}/${
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(req.params as any)?.action
}?errorCodes=unknown`
)
}
res.setHeader('set-cookie', result.headers['set-cookie'])
await handleSuccessfulLogin(req, res, data.login.me, false)