mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Better handling of situations where we fail to set the cookie during auth
This commit is contained in:
parent
165085a639
commit
65cd8a95eb
1 changed files with 20 additions and 2 deletions
|
|
@ -275,7 +275,16 @@ export function authRouter() {
|
|||
)
|
||||
}
|
||||
|
||||
res.setHeader('set-cookie', String(result.headers['set-cookie']))
|
||||
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,7 +393,16 @@ export function authRouter() {
|
|||
)
|
||||
}
|
||||
|
||||
res.setHeader('set-cookie', String(result.headers['set-cookie']))
|
||||
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)
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue