mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-17 18:40:59 +02:00
Update refresh endpoint to support override cookie token
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user