Skip to content

Commit 0ba8156

Browse files
refactor: use HTTP status constants
1 parent 9850fcf commit 0ba8156

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

quantara/web_app/api/wallet_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44
from typing import Dict, Tuple
55

6-
from fastapi import APIRouter, Header, HTTPException, Query
6+
from fastapi import APIRouter, Header, HTTPException, Query, status
77

88
from stellar_sdk import Keypair
99

@@ -72,12 +72,12 @@ async def verify_wallet_signature(
7272
"""FastAPI dependency -- verifies a Stellar wallet signature and returns the wallet_id."""
7373
if not _consume_nonce(x_nonce, x_wallet_id):
7474
raise HTTPException(
75-
status_code=401,
75+
status_code=status.HTTP_401_UNAUTHORIZED,
7676
detail="Invalid or expired nonce. Request a fresh nonce from /api/auth/nonce.",
7777
)
7878
if not _verify_stellar_signature(x_wallet_id, x_nonce, x_signature):
7979
raise HTTPException(
80-
status_code=401,
80+
status_code=status.HTTP_401_UNAUTHORIZED,
8181
detail="Signature verification failed. Ensure the nonce was signed with the correct key.",
8282
)
8383
return x_wallet_id

0 commit comments

Comments
 (0)