From a9f06f219bb18075770f1b4ad7c132cfdcb05929 Mon Sep 17 00:00:00 2001 From: ytqh Date: Sat, 29 Mar 2025 11:24:47 +0800 Subject: [PATCH] fix login error --- .../service_api_with_auth/auth/login.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/api/controllers/service_api_with_auth/auth/login.py b/api/controllers/service_api_with_auth/auth/login.py index 6fa4a6d85f..413eead3d4 100644 --- a/api/controllers/service_api_with_auth/auth/login.py +++ b/api/controllers/service_api_with_auth/auth/login.py @@ -70,6 +70,7 @@ class EmailCodeLoginSendEmailApi(Resource): email: type: string description: The user's email + example: "test@test.edu" language: type: string description: Preferred language for the email @@ -139,9 +140,11 @@ class EmailCodeLoginApi(Resource): email: type: string description: The user's email + example: "test@test.edu" code: type: string description: The verification code sent to the email + example: "111111" token: type: string description: The token associated with the email code login @@ -208,20 +211,13 @@ class EmailCodeLoginApi(Resource): interface_language=languages[0], ) - # Assign organization if found - if organization: - OrganizationService.assign_account_to_organization(account, organization.id) + OrganizationService.assign_account_to_organization(account, organization.id) else: - if account.organization_id is not None and account.organization_id != organization.id: + if account.current_organization_id is not None and account.current_organization_id != organization.id: raise OrganizationMismatchError() - # Update organization if needed - if organization: - OrganizationService.assign_account_to_organization(account, organization.id) - - # Ensure account is member of tenant connected_tenant = TenantService.get_join_tenants(account) if connected_tenant is None or tenant not in connected_tenant: TenantService.create_tenant_member(tenant, account, role="end_user")