fix: исправить ответ 204 при удалении текущей сессии

Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
Evgeny Bushkov
2026-10-23 18:39:40 +03:00
co-authored by aider
parent ed7b43ecac
commit 1a08e3a6a3
+2 -2
View File
@@ -5,7 +5,7 @@ import logging
from typing import Any from typing import Any
from fastapi import APIRouter, Body, Header, Query, Request from fastapi import APIRouter, Body, Header, Query, Request
from fastapi.responses import JSONResponse from fastapi.responses import JSONResponse, Response
from .errors import ApiError from .errors import ApiError
from .security import hash_password, verify_password from .security import hash_password, verify_password
@@ -134,7 +134,7 @@ def revoke_session(
if not token or get_sessions(request).resolve(token) is None: if not token or get_sessions(request).resolve(token) is None:
raise _unauthorized("Недействительная сессия", BEARER_CHALLENGE) raise _unauthorized("Недействительная сессия", BEARER_CHALLENGE)
get_sessions(request).revoke(token) get_sessions(request).revoke(token)
return JSONResponse(status_code=204) return Response(status_code=204)
@router.get("/api/v1/users/me") @router.get("/api/v1/users/me")