mirror of
https://github.com/OpenBankProject/API-Explorer-II.git
synced 2026-02-06 10:47:04 +00:00
session timeout
This commit is contained in:
parent
245893a33d
commit
498a509b2d
@ -26,6 +26,13 @@ VITE_OBP_OAUTH2_TOKEN_REFRESH_THRESHOLD=300
|
||||
|
||||
### Session Configuration (Optional) ###
|
||||
# VITE_SESSION_MAX_AGE=3600 # Session timeout in seconds (default: 3600 = 1 hour)
|
||||
# Common values:
|
||||
# 1800 = 30 minutes
|
||||
# 3600 = 1 hour (default)
|
||||
# 7200 = 2 hours
|
||||
# 14400 = 4 hours
|
||||
# 28800 = 8 hours (full work day)
|
||||
# 86400 = 24 hours
|
||||
|
||||
### Styling Configuration (Optional) ###
|
||||
# VITE_OBP_LOGO_URL=https://example.com/logo.png # Custom logo image URL (uses default OBP logo if not set)
|
||||
|
||||
@ -118,6 +118,13 @@ export class UserController {
|
||||
session['oauth2_token_timestamp'] = Date.now()
|
||||
session['oauth2_expires_in'] = newTokens.expiresIn
|
||||
|
||||
// CRITICAL: Update clientConfig with new access token
|
||||
// This ensures subsequent API calls use the refreshed token
|
||||
if (session['clientConfig'] && session['clientConfig'].oauth2) {
|
||||
session['clientConfig'].oauth2.accessToken = newTokens.accessToken
|
||||
console.log('UserController: Updated clientConfig with new access token')
|
||||
}
|
||||
|
||||
console.log('UserController: Token refresh successful')
|
||||
} catch (error) {
|
||||
console.error('UserController: Token refresh failed:', error)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user