mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-09 03:04:08 -04:00
Update oidc redirect to pass both new and old token in url
This commit is contained in:
parent
ad092ef8f8
commit
6cc7a44a22
@ -305,8 +305,8 @@ export default {
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
// Token passed as query parameter after successful oidc login
|
// Token passed as query parameter after successful oidc login
|
||||||
if (this.$route.query?.setToken) {
|
if (this.$route.query?.accessToken) {
|
||||||
localStorage.setItem('token', this.$route.query.setToken)
|
localStorage.setItem('token', this.$route.query.accessToken)
|
||||||
}
|
}
|
||||||
if (localStorage.getItem('token')) {
|
if (localStorage.getItem('token')) {
|
||||||
if (await this.checkAuth()) return // if valid user no need to check status
|
if (await this.checkAuth()) return // if valid user no need to check status
|
||||||
|
@ -266,7 +266,8 @@ class Auth {
|
|||||||
if (req.cookies.auth_cb) {
|
if (req.cookies.auth_cb) {
|
||||||
let stateQuery = req.cookies.auth_state ? `&state=${req.cookies.auth_state}` : ''
|
let stateQuery = req.cookies.auth_state ? `&state=${req.cookies.auth_state}` : ''
|
||||||
// UI request -> redirect to auth_cb url and send the jwt token as parameter
|
// UI request -> redirect to auth_cb url and send the jwt token as parameter
|
||||||
res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.accessToken}${stateQuery}`)
|
// TODO: Temporarily continue sending the old token as setToken
|
||||||
|
res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.token}&accessToken=${userResponse.user.accessToken}${stateQuery}`)
|
||||||
} else {
|
} else {
|
||||||
res.status(400).send('No callback or already expired')
|
res.status(400).send('No callback or already expired')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user