File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ VITE_OBP_OAUTH2_TOKEN_REFRESH_THRESHOLD=300
2626
2727### Session Configuration (Optional) ###
2828# VITE_SESSION_MAX_AGE=3600 # Session timeout in seconds (default: 3600 = 1 hour)
29+ # Common values:
30+ # 1800 = 30 minutes
31+ # 3600 = 1 hour (default)
32+ # 7200 = 2 hours
33+ # 14400 = 4 hours
34+ # 28800 = 8 hours (full work day)
35+ # 86400 = 24 hours
2936
3037### Styling Configuration (Optional) ###
3138# VITE_OBP_LOGO_URL=https://example.com/logo.png # Custom logo image URL (uses default OBP logo if not set)
Original file line number Diff line number Diff line change @@ -118,6 +118,13 @@ export class UserController {
118118 session [ 'oauth2_token_timestamp' ] = Date . now ( )
119119 session [ 'oauth2_expires_in' ] = newTokens . expiresIn
120120
121+ // CRITICAL: Update clientConfig with new access token
122+ // This ensures subsequent API calls use the refreshed token
123+ if ( session [ 'clientConfig' ] && session [ 'clientConfig' ] . oauth2 ) {
124+ session [ 'clientConfig' ] . oauth2 . accessToken = newTokens . accessToken
125+ console . log ( 'UserController: Updated clientConfig with new access token' )
126+ }
127+
121128 console . log ( 'UserController: Token refresh successful' )
122129 } catch ( error ) {
123130 console . error ( 'UserController: Token refresh failed:' , error )
You can’t perform that action at this time.
0 commit comments