mirror of https://github.com/langgenius/dify.git
feat: update EmailOrPasswordMismatchError
This commit is contained in:
parent
82ebe88c38
commit
514f839368
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ from constants.languages import languages
|
|||
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
|
||||
|
|
@ -41,7 +41,7 @@ class LoginApi(Resource):
|
|||
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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue