From 4e99ab7acec33ab666dd01e90d4031d25f72618a Mon Sep 17 00:00:00 2001 From: Akshay Avinash Date: Fri, 16 Oct 2020 19:48:03 +0530 Subject: [PATCH] Fix 781 invalid message on password reset failure (#1234) * Updated to add button to redirect to forgot password page --- app/client/src/pages/UserAuth/ResetPassword.tsx | 13 +++++++++++++ .../appsmith/server/exceptions/AppsmithError.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/client/src/pages/UserAuth/ResetPassword.tsx b/app/client/src/pages/UserAuth/ResetPassword.tsx index 21c867318c..9051027b3c 100644 --- a/app/client/src/pages/UserAuth/ResetPassword.tsx +++ b/app/client/src/pages/UserAuth/ResetPassword.tsx @@ -122,6 +122,19 @@ export const ResetPassword = (props: ResetPasswordProps) => { } if (showFailureMessage) { message = error; + if ( + message + .toLowerCase() + .includes(RESET_PASSWORD_FORGOT_PASSWORD_LINK.toLowerCase()) + ) { + messageActions = [ + { + url: FORGOT_PASSWORD_URL, + text: RESET_PASSWORD_FORGOT_PASSWORD_LINK, + intent: "primary", + }, + ]; + } } const messageTagProps: FormMessageProps = { diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java index d1a6ff58df..59622e0df4 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java @@ -28,7 +28,7 @@ public enum AppsmithError { USER_ALREADY_EXISTS_IN_ORGANIZATION(400, 4021, "The user {0} has already been added to the organization with role {1}"), UNAUTHORIZED_DOMAIN(401, 4019, "Invalid email domain provided. Please sign in with a valid work email ID"), USER_NOT_SIGNED_IN(401, 4020, "User is not logged in. Please sign in with the registered email ID or sign up" ), - INVALID_PASSWORD_RESET(400, 4020, "Unable to reset the password. Please initiate a request via 'forgot password' link to reset your password"), + INVALID_PASSWORD_RESET(400, 4020, "Unable to reset the password. Please initiate a request via 'forgot password' button to reset your password"), LOGIN_INTERNAL_ERROR(401, 4021, "Internal error while trying to login"), JSON_PROCESSING_ERROR(400, 4022, "Json processing error with error {0}"), INVALID_CREDENTIALS(200, 4023, "Invalid credentials provided. Did you input the credentials correctly?"),