mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-13 14:08:51 +01:00
🍪 refactor: Move OpenID Tokens from Cookies to Server-Side Sessions (#11236)
* refactor: OpenID token handling by storing tokens in session to reduce cookie size * refactor: Improve OpenID user identification logic in logout controller * refactor: Enhance OpenID logout flow by adding post-logout redirect URI * refactor: Update logout process to clear additional OpenID user ID cookie
This commit is contained in:
parent
3b41e392ba
commit
348b4a4a32
8 changed files with 105 additions and 38 deletions
9
api/cache/banViolation.js
vendored
9
api/cache/banViolation.js
vendored
|
|
@ -47,7 +47,16 @@ const banViolation = async (req, res, errorMessage) => {
|
|||
}
|
||||
|
||||
await deleteAllUserSessions({ userId: user_id });
|
||||
|
||||
/** Clear OpenID session tokens if present */
|
||||
if (req.session?.openidTokens) {
|
||||
delete req.session.openidTokens;
|
||||
}
|
||||
|
||||
res.clearCookie('refreshToken');
|
||||
res.clearCookie('openid_access_token');
|
||||
res.clearCookie('openid_user_id');
|
||||
res.clearCookie('token_provider');
|
||||
|
||||
const banLogs = getLogStores(ViolationTypes.BAN);
|
||||
const duration = errorMessage.duration || banLogs.opts.ttl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue