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-5907] fix: magic code sign-in at Space app. #8552

Vamsi Krishnaf783447796de
diff --git a/apps/space/core/components/account/auth-forms/auth-root.tsx b/apps/space/core/components/account/auth-forms/auth-root.tsx
index e313cce893..4c54e947c3 100644
--- a/apps/space/core/components/account/auth-forms/auth-root.tsx
+++ b/apps/space/core/components/account/auth-forms/auth-root.tsx
@@ -98,7 +98,7 @@ export const AuthRoot = observer(function AuthRoot() {
}
if (currentAuthMode === EAuthModes.SIGN_IN) {
- if (response.is_password_autoset && isSMTPConfigured && isMagicLoginEnabled) {
+ if (isSMTPConfigured && isMagicLoginEnabled && response.status === "MAGIC_CODE") {
setAuthStep(EAuthSteps.UNIQUE_CODE);
generateEmailUniqueCode(data.email);
} else if (isEmailPasswordEnabled) {
@@ -109,7 +109,7 @@ export const AuthRoot = observer(function AuthRoot() {
setErrorInfo(errorhandler);
}
} else {
- if (isSMTPConfigured && isMagicLoginEnabled) {
+ if (isSMTPConfigured && isMagicLoginEnabled && response.status === "MAGIC_CODE") {
setAuthStep(EAuthSteps.UNIQUE_CODE);
generateEmailUniqueCode(data.email);
} else if (isEmailPasswordEnabled) {
@@ -119,6 +119,7 @@ export const AuthRoot = observer(function AuthRoot() {
setErrorInfo(errorhandler);
}
}
+ return;
})
.catch((error) => {
const errorhandler = authErrorHandler(error?.error_code?.toString(), data?.email || undefined);
diff --git a/apps/space/core/types/auth.ts b/apps/space/core/types/auth.ts
index 19a616871e..45e501ba4f 100644
--- a/apps/space/core/types/auth.ts
+++ b/apps/space/core/types/auth.ts
@@ -19,6 +19,7 @@ export interface IEmailCheckData {
}
export interface IEmailCheckResponse {
+ status: "MAGIC_CODE" | "CREDENTIAL";
is_password_autoset: boolean;
existing: boolean;
}