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:
François Voron
2021-04-20 13:54:50 +02:00
parent 461e84acae
commit d184d7e90c
3 changed files with 4 additions and 11 deletions

View File

@ -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,