Fixed structure of UI, Added some logic to Auth

This commit is contained in:
maciejrusek
2026-04-28 20:33:08 +02:00
parent f306606b34
commit 54c7bb47b5
9 changed files with 150 additions and 53 deletions

View File

@@ -15,10 +15,7 @@ public class UserService {
public Optional<User> login(String username, String password) {
try {
return Optional.empty();
return userRepository.getUser(username, password);
} catch (Exception e) {
System.out.println(e.getMessage());
return Optional.empty();
@@ -27,6 +24,10 @@ public class UserService {
public Optional<User> register(String username, String email, String password) {
try {
if (userRepository.userExists(username)) {
return Optional.empty();
}
return userRepository.saveUser(username, email, password);
} catch (Exception e) {
e.printStackTrace();