fix: better differentiation between UNAUTHORIZED and FORBIDDEN (#3139)

This commit is contained in:
Vlad Stan
2025-05-05 10:55:58 +02:00
committed by GitHub
parent 6a9089fd98
commit 3529f9152f
7 changed files with 39 additions and 45 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ async def test_check_user_exists_with_user_not_allowed(user_alan: User):
settings.lnbits_allowed_users = ["only_this_user_id"]
with pytest.raises(HTTPException) as exc_info:
await check_user_exists(request, access_token=None, usr=UUID4(user_alan.id))
assert exc_info.value.status_code == 401
assert exc_info.value.status_code == 403
assert exc_info.value.detail == "User not allowed."