mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 01:41:35 +00:00
Merge b37cc9e4ce into 6f03467f35
This commit is contained in:
commit
c1b7699278
1 changed files with 7 additions and 1 deletions
|
|
@ -385,7 +385,13 @@ class Auth {
|
||||||
const sessionKey = this.oidcAuthStrategy.getStrategy()._key
|
const sessionKey = this.oidcAuthStrategy.getStrategy()._key
|
||||||
|
|
||||||
if (!req.session[sessionKey]) {
|
if (!req.session[sessionKey]) {
|
||||||
return res.status(400).send('No session')
|
Logger.warn(`[Auth] No openid session found in callback - restarting login`)
|
||||||
|
const isMobileFlow = !!req.query.code_verifier
|
||||||
|
return req.session.destroy(() => {
|
||||||
|
res.clearCookie('connect.sid')
|
||||||
|
if (isMobileFlow) return res.status(400).send('No session')
|
||||||
|
res.redirect(`/login?error=${encodeURIComponent('Login session expired, please try again')}&autoLaunch=0`)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the client sends us a code_verifier, we will tell passport to use this to send this in the token request
|
// If the client sends us a code_verifier, we will tell passport to use this to send this in the token request
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue