Skip to content

Commit 2a4dc97

Browse files
committed
changed http exception code to 401 when entered invalid creds and resolved pop up issue
1 parent c2006ea commit 2a4dc97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/library/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def check_auth(
5151
db, user_name=credentials.username, password=credentials.password
5252
)
5353
if not user:
54-
raise HTTPException(status_code=400, detail="Incorrect email or password")
54+
raise HTTPException(status_code=401, detail="Incorrect email or password", headers={"WWW-Authenticate": "Basic"})
5555
elif not crud_user.is_active(user):
5656
raise HTTPException(status_code=400, detail="Inactive user")
5757
return credentials.username

0 commit comments

Comments
 (0)