Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 46aadd77 authored by riorio805's avatar riorio805
Browse files

[REFACTOR] change exception type to better reflect what errored

parent 5889deb8
Branches
No related tags found
1 merge request!1Login registration
...@@ -53,7 +53,7 @@ public class AuthenticationService { ...@@ -53,7 +53,7 @@ public class AuthenticationService {
User existing = userRepository.findByEmail(request.getEmail()); User existing = userRepository.findByEmail(request.getEmail());
if (existing != null) { if (existing != null) {
if (EMAIL_PROVIDER.equals(existing.getProvider())) { if (EMAIL_PROVIDER.equals(existing.getProvider())) {
throw new IllegalArgumentException("An account with this email exists. Please sign in using your email and password."); throw new UserAlreadyExistsException("An account with this email exists. Please sign in using your email and password.");
} }
return existing; return existing;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment