mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-25 20:15:41 +02:00
Add additional debug logs for OIDC login
This commit is contained in:
parent
dcaca43817
commit
fd4932cdbb
1 changed files with 4 additions and 0 deletions
|
@ -243,6 +243,7 @@ class Auth {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the authentication method for long
|
// Store the authentication method for long
|
||||||
|
Logger.debug(`[Auth] paramsToCookies: setting auth_method cookie to ${authMethod}`)
|
||||||
res.cookie('auth_method', authMethod, { maxAge: 1000 * 60 * 60 * 24 * 365 * 10, httpOnly: true })
|
res.cookie('auth_method', authMethod, { maxAge: 1000 * 60 * 60 * 24 * 365 * 10, httpOnly: true })
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -258,6 +259,7 @@ class Auth {
|
||||||
// Handle token generation and get userResponse object
|
// Handle token generation and get userResponse object
|
||||||
// For API based auth (e.g. mobile), we will return the refresh token in the response
|
// For API based auth (e.g. mobile), we will return the refresh token in the response
|
||||||
const isApiBased = this.isAuthMethodAPIBased(req.cookies.auth_method)
|
const isApiBased = this.isAuthMethodAPIBased(req.cookies.auth_method)
|
||||||
|
Logger.debug(`[Auth] handleLoginSuccessBasedOnCookie: isApiBased: ${isApiBased}, auth_method: ${req.cookies.auth_method}`)
|
||||||
const userResponse = await this.handleLoginSuccess(req, res, isApiBased)
|
const userResponse = await this.handleLoginSuccess(req, res, isApiBased)
|
||||||
|
|
||||||
if (isApiBased) {
|
if (isApiBased) {
|
||||||
|
@ -298,6 +300,8 @@ class Auth {
|
||||||
userResponse.user.refreshToken = returnTokens ? refreshToken : null
|
userResponse.user.refreshToken = returnTokens ? refreshToken : null
|
||||||
userResponse.user.accessToken = accessToken
|
userResponse.user.accessToken = accessToken
|
||||||
|
|
||||||
|
Logger.debug(`[Auth] handleLoginSuccess: returnTokens: ${returnTokens}, isRefreshTokenInResponse: ${!!userResponse.user.refreshToken}`)
|
||||||
|
|
||||||
if (!returnTokens) {
|
if (!returnTokens) {
|
||||||
this.tokenManager.setRefreshTokenCookie(req, res, refreshToken)
|
this.tokenManager.setRefreshTokenCookie(req, res, refreshToken)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue