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.

chore: handled suppert email validation in the admin app (#4560)

guru_sainathc9e6ead3af7d
diff --git a/admin/helpers/authentication.helper.tsx b/admin/helpers/authentication.helper.tsx
index 6bfccd45e6..cc9058611c 100644
--- a/admin/helpers/authentication.helper.tsx
+++ b/admin/helpers/authentication.helper.tsx
@@ -1,5 +1,7 @@
import { ReactNode } from "react";
import Link from "next/link";
+// helpers
+import { SUPPORT_EMAIL } from "./common.helper";
export enum EPageTypes {
PUBLIC = "PUBLIC",
@@ -38,6 +40,7 @@ export enum EAuthenticationErrorCodes {
ADMIN_AUTHENTICATION_FAILED = "5175",
ADMIN_USER_ALREADY_EXIST = "5180",
ADMIN_USER_DOES_NOT_EXIST = "5185",
+ ADMIN_USER_DEACTIVATED = "5190",
}
export type TAuthErrorInfo = {
@@ -99,6 +102,10 @@ const errorCodeMessages: {
</div>
),
},
+ [EAuthenticationErrorCodes.ADMIN_USER_DEACTIVATED]: {
+ title: `User account deactivated`,
+ message: () => `User account deactivated. Please contact ${!!SUPPORT_EMAIL ? SUPPORT_EMAIL : "administrator"}.`,
+ },
};
export const authErrorHandler = (
@@ -106,6 +113,7 @@ export const authErrorHandler = (
email?: string | undefined
): TAuthErrorInfo | undefined => {
const bannerAlertErrorCodes = [
+ EAuthenticationErrorCodes.ADMIN_ALREADY_EXIST,
EAuthenticationErrorCodes.REQUIRED_ADMIN_EMAIL_PASSWORD_FIRST_NAME,
EAuthenticationErrorCodes.INVALID_ADMIN_EMAIL,
EAuthenticationErrorCodes.INVALID_ADMIN_PASSWORD,
@@ -113,6 +121,7 @@ export const authErrorHandler = (
EAuthenticationErrorCodes.ADMIN_AUTHENTICATION_FAILED,
EAuthenticationErrorCodes.ADMIN_USER_ALREADY_EXIST,
EAuthenticationErrorCodes.ADMIN_USER_DOES_NOT_EXIST,
+ EAuthenticationErrorCodes.ADMIN_USER_DEACTIVATED,
];
if (bannerAlertErrorCodes.includes(errorCode))
diff --git a/admin/helpers/common.helper.ts b/admin/helpers/common.helper.ts
index e7aae0698f..e282e57925 100644
--- a/admin/helpers/common.helper.ts
+++ b/admin/helpers/common.helper.ts
@@ -10,6 +10,8 @@ export const SPACE_BASE_PATH = process.env.NEXT_PUBLIC_SPACE_BASE_PATH || "";
export const WEB_BASE_URL = process.env.NEXT_PUBLIC_WEB_BASE_URL || "";
+export const SUPPORT_EMAIL = process.env.NEXT_PUBLIC_SUPPORT_EMAIL || "";
+
export const ASSET_PREFIX = ADMIN_BASE_PATH;
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));