【ACM】 还原单点登录

pull/22121/head
lengjs@wsidomidata.com 12 months ago
parent 32f6ed8214
commit b12f5b8c12

@ -176,6 +176,21 @@ class AccountService:
return cast(Account, account) return cast(Account, account)
@staticmethod
def authenticate_email(email: str, tenantId: str) -> None | Account:
account = db.session.query(Account).filter_by(email=email, target_tenant_id=tenantId).first()
if not account:
raise AccountNotFoundError()
if account.status == AccountStatus.BANNED.value:
raise AccountLoginError("Account is banned.")
if account.status == AccountStatus.PENDING.value:
account.status = AccountStatus.ACTIVE.value
account.initialized_at = datetime.now(UTC).replace(tzinfo=None)
db.session.commit()
return cast(Account, account)
@staticmethod @staticmethod
def update_account_password(account, password, new_password): def update_account_password(account, password, new_password):

Loading…
Cancel
Save