mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Revert "(UI) - Improvements to session handling logic (#8970)"
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 15s
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 15s
This reverts commit c015fb34f1
.
This commit is contained in:
parent
772c2b1fff
commit
4c8b4fefc9
7 changed files with 52 additions and 116 deletions
|
@ -1,24 +0,0 @@
|
|||
import time
|
||||
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
|
||||
class UISessionHandler:
|
||||
@staticmethod
|
||||
def generate_authenticated_redirect_response(
|
||||
redirect_url: str, jwt_token: str
|
||||
) -> RedirectResponse:
|
||||
redirect_response = RedirectResponse(url=redirect_url, status_code=303)
|
||||
redirect_response.set_cookie(
|
||||
key=UISessionHandler._generate_token_name(),
|
||||
value=jwt_token,
|
||||
secure=True,
|
||||
samesite="strict",
|
||||
)
|
||||
return redirect_response
|
||||
|
||||
@staticmethod
|
||||
def _generate_token_name() -> str:
|
||||
current_timestamp = int(time.time())
|
||||
cookie_name = f"token_{current_timestamp}"
|
||||
return cookie_name
|
Loading…
Add table
Add a link
Reference in a new issue