From 3414195b690bf705a7c04a3327cee2efea19e856 Mon Sep 17 00:00:00 2001 From: Abhijeet <41686026+abhvsn@users.noreply.github.com> Date: Tue, 31 Aug 2021 16:13:21 +0530 Subject: [PATCH] [skip_changelog] Update error message for sign-in source capitalization issue for OAuth (#7004) --- .../authentication/handlers/CustomFormLoginServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/CustomFormLoginServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/CustomFormLoginServiceImpl.java index 39f7fbe4aa..177ba6f986 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/CustomFormLoginServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/authentication/handlers/CustomFormLoginServiceImpl.java @@ -4,6 +4,7 @@ import com.appsmith.server.domains.LoginSource; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.repositories.UserRepository; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.WordUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.InternalAuthenticationServiceException; import org.springframework.security.core.userdetails.ReactiveUserDetailsService; @@ -49,7 +50,9 @@ public class CustomFormLoginServiceImpl implements ReactiveUserDetailsService { // We can have a implementation to give which login method user should use but this will // expose the sign-in source for external world and in turn to spammers throw new InternalAuthenticationServiceException( - AppsmithError.INVALID_LOGIN_METHOD.getMessage(user.getSource().toString()) + AppsmithError.INVALID_LOGIN_METHOD.getMessage( + WordUtils.capitalize(user.getSource().toString().toLowerCase()) + ) ); } return user;