mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 06:39:37 +02:00
Update oidc to return refresh token in response body for mobile
This commit is contained in:
parent
97afd22f81
commit
d9cfcc86e7
1 changed files with 4 additions and 3 deletions
|
@ -399,10 +399,11 @@ class Auth {
|
||||||
*/
|
*/
|
||||||
async handleLoginSuccessBasedOnCookie(req, res) {
|
async handleLoginSuccessBasedOnCookie(req, res) {
|
||||||
// Handle token generation and get userResponse object
|
// Handle token generation and get userResponse object
|
||||||
// TODO: where to check if refresh tokens should be returned?
|
// For API based auth (e.g. mobile), we will return the refresh token in the response
|
||||||
const userResponse = await this.handleLoginSuccess(req, res, false)
|
const isApiBased = this.isAuthMethodAPIBased(req.cookies.auth_method)
|
||||||
|
const userResponse = await this.handleLoginSuccess(req, res, isApiBased)
|
||||||
|
|
||||||
if (this.isAuthMethodAPIBased(req.cookies.auth_method)) {
|
if (isApiBased) {
|
||||||
// REST request - send data
|
// REST request - send data
|
||||||
res.json(userResponse)
|
res.json(userResponse)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue