mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-01 01:48:46 +08:00
Fix #609: make behavior more consistent on request verify token
Now, it always returns 202 even if the user is already verified
This commit is contained in:
@ -36,12 +36,7 @@ def get_verify_router(
|
||||
):
|
||||
try:
|
||||
user = await get_user(email)
|
||||
if user.is_verified:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=ErrorCode.VERIFY_USER_ALREADY_VERIFIED,
|
||||
)
|
||||
elif user.is_active:
|
||||
if not user.is_verified and user.is_active:
|
||||
token_data = {
|
||||
"user_id": str(user.id),
|
||||
"email": email,
|
||||
|
||||
Reference in New Issue
Block a user