From b14d44049c285cdb29a0dee2d68c78adf1e97904 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Wed, 15 May 2024 22:10:47 +0530 Subject: [PATCH] [WEB-1328] chore: magic sign-in redirection (#4470) * chore: magic signin redirection * chore: expired magic code error message --- .../plane/authentication/provider/credentials/magic_code.py | 4 +++- apiserver/plane/authentication/views/app/magic.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apiserver/plane/authentication/provider/credentials/magic_code.py b/apiserver/plane/authentication/provider/credentials/magic_code.py index 1496544c7..aa66b42f1 100644 --- a/apiserver/plane/authentication/provider/credentials/magic_code.py +++ b/apiserver/plane/authentication/provider/credentials/magic_code.py @@ -135,8 +135,10 @@ class MagicCodeProvider(CredentialAdapter): payload={"email": str(email)}, ) else: + magic_key = str(self.key) + email = magic_key.replace("magic_", "", 1) raise AuthenticationException( error_code=AUTHENTICATION_ERROR_CODES["EXPIRED_MAGIC_CODE"], error_message="EXPIRED_MAGIC_CODE", - payload={"email": str(self.key)}, + payload={"email": str(email)}, ) diff --git a/apiserver/plane/authentication/views/app/magic.py b/apiserver/plane/authentication/views/app/magic.py index 695776054..8ad71dea0 100644 --- a/apiserver/plane/authentication/views/app/magic.py +++ b/apiserver/plane/authentication/views/app/magic.py @@ -145,7 +145,7 @@ class MagicSignInEndpoint(View): path = ( str(next_path) if next_path - else str(process_workspace_project_invitations(user=user)) + else str(get_redirection_path(user=user)) ) # redirect to referer path url = urljoin(base_host(request=request, is_app=True), path)