mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 19:34:57 +02:00
Update refresh endpoint to support override cookie token
This commit is contained in:
parent
8b995a179d
commit
44ff90a6f2
1 changed files with 2 additions and 1 deletions
|
@ -484,8 +484,9 @@ class Auth {
|
|||
let refreshToken = req.cookies.refresh_token
|
||||
|
||||
// For mobile clients, the refresh token is sent in the authorization header
|
||||
// Force return refresh token if x-return-tokens header is true
|
||||
let shouldReturnRefreshToken = false
|
||||
if (!refreshToken && req.headers.authorization?.startsWith('Bearer ')) {
|
||||
if (req.headers.authorization?.startsWith('Bearer ') && (!refreshToken || req.headers['x-return-tokens'] === 'true')) {
|
||||
refreshToken = req.headers.authorization.split(' ')[1]
|
||||
shouldReturnRefreshToken = true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue