mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
Fix: Send different exception for users with an alias as email (#1630)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
parent
44e0dd8635
commit
432fb3fcf7
@ -11,7 +11,7 @@ from app.email_utils import send_welcome_email
|
|||||||
from app.utils import sanitize_email
|
from app.utils import sanitize_email
|
||||||
from app.errors import (
|
from app.errors import (
|
||||||
AccountAlreadyLinkedToAnotherPartnerException,
|
AccountAlreadyLinkedToAnotherPartnerException,
|
||||||
AccountAlreadyLinkedToAnotherUserException,
|
AccountIsUsingAliasAsEmail,
|
||||||
)
|
)
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import (
|
from app.models import (
|
||||||
@ -199,7 +199,7 @@ def get_login_strategy(
|
|||||||
def check_alias(email: str) -> bool:
|
def check_alias(email: str) -> bool:
|
||||||
alias = Alias.get_by(email=email)
|
alias = Alias.get_by(email=email)
|
||||||
if alias is not None:
|
if alias is not None:
|
||||||
raise AccountAlreadyLinkedToAnotherUserException()
|
raise AccountIsUsingAliasAsEmail()
|
||||||
|
|
||||||
|
|
||||||
def process_login_case(
|
def process_login_case(
|
||||||
|
Loading…
Reference in New Issue
Block a user