// Path: src/main/java/com/nuvola/myproject/server/service/UserService.java
// public interface UserService {
//     User getUserByUsername(String username);
// 
//     List<String> getPermissions(String username);
// 
//     User getCurrentUser();
// 
//     Boolean isCurrentUserLoggedIn();
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/model/User.java
// public class User {
//     private String login;
//     private String email;
//     private String firstName;
//     private String lastName;
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }


import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.nuvola.myproject.server.service.UserService;
import com.nuvola.myproject.shared.model.User;
package com.nuvola.myproject.server.security;




@Service
public class NuvolaUserDetailsService implements UserDetailsService {
    private final UserService userService;

    @Autowired
    NuvolaUserDetailsService(UserService userService) {
        this.userService = userService;
    }

    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// Path: src/main/java/com/nuvola/myproject/server/service/UserService.java
// public interface UserService {
//     User getUserByUsername(String username);
// 
//     List<String> getPermissions(String username);
// 
//     User getCurrentUser();
// 
//     Boolean isCurrentUserLoggedIn();
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/model/User.java
// public class User {
//     private String login;
//     private String email;
//     private String firstName;
//     private String lastName;
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }


// Path: src/main/java/com/nuvola/myproject/server/security/NuvolaUserDetailsService.java
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.nuvola.myproject.server.service.UserService;
import com.nuvola.myproject.shared.model.User;

package com.nuvola.myproject.server.security;




@Service
public class NuvolaUserDetailsService implements UserDetailsService {
    private final UserService userService;

    @Autowired
    NuvolaUserDetailsService(UserService userService) {
        this.userService = userService;
    }

    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        User user = userService.getUserByUsername(username);