Skip to content

Commit

Permalink
feat: update EmailOrPasswordMismatchError
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouhaoJiang committed Sep 14, 2024
1 parent 82ebe88 commit 514f839
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/controllers/console/auth/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ class EmailCodeError(BaseHTTPException):
error_code = "email_code_error"
description = "Email code is invalid or expired."
code = 400


class EmailOrPasswordMismatchError(BaseHTTPException):
error_code = "email_or_password_mismatch"
description = "The email or password is incorrect."
code = 400
4 changes: 2 additions & 2 deletions api/controllers/console/auth/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from controllers.console import api
from controllers.console.auth.error import (
EmailCodeError,
EmailOrPasswordMismatchError,
InvalidEmailError,
InvalidTokenError,
PasswordMismatchError,
)
from controllers.console.error import NotAllowedCreateWorkspace, NotAllowedRegister
from controllers.console.setup import setup_required
Expand Down Expand Up @@ -41,7 +41,7 @@ def post(self):
except services.errors.account.AccountLoginError:
raise NotAllowedRegister()
except services.errors.account.AccountPasswordError:
raise PasswordMismatchError()
raise EmailOrPasswordMismatchError()
except services.errors.account.AccountNotFoundError:
if not dify_config.ALLOW_REGISTER:
raise NotAllowedRegister()
Expand Down

0 comments on commit 514f839

Please sign in to comment.