Changed logic for auth token refresh
This commit is contained in:
@@ -196,6 +196,19 @@ async def logout(request: Request):
|
||||
return AuthController.logout()
|
||||
|
||||
|
||||
# Define the token refresh endpoint
|
||||
@app.post("/api/auth/refresh")
|
||||
async def refresh_token(request: Request):
|
||||
"""
|
||||
Silently refresh the access token using the refresh token cookie.
|
||||
This should be called by the frontend before the access token expires.
|
||||
|
||||
Returns:
|
||||
dict: Success status and new expiration time.
|
||||
"""
|
||||
return AuthController.refresh_token(request)
|
||||
|
||||
|
||||
# Define the protected endpoint (kept for API token-based access)
|
||||
@app.get("/api/protected", response_model=UserInfo)
|
||||
async def protected_endpoint(
|
||||
|
||||
Reference in New Issue
Block a user