Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1328] chore: magic sign-in redirection (#4470)

Bavisetti Narayanb14d44049c28
diff --git a/apiserver/plane/authentication/provider/credentials/magic_code.py b/apiserver/plane/authentication/provider/credentials/magic_code.py
index 1496544c72..aa66b42f1a 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 695776054c..8ad71dea05 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)