Ignore:
Timestamp:
05/24/23 23:18:47 (18 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
77205be
Parents:
8bcd64c
Message:

Periodic update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/services/PostgresUserDetailsService.java

    r8bcd64c r950fa0d  
    88import edu.gjoko.schedlr.repositories.StakeholderRepository;
    99import lombok.RequiredArgsConstructor;
    10 import org.springframework.security.access.AccessDeniedException;
    1110import org.springframework.security.core.GrantedAuthority;
    1211import org.springframework.security.core.authority.SimpleGrantedAuthority;
     
    1514import org.springframework.security.core.userdetails.UserDetailsService;
    1615import org.springframework.security.core.userdetails.UsernameNotFoundException;
    17 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
    1816import org.springframework.stereotype.Service;
    1917
     
    2624
    2725    private final StakeholderRepository stakeholderRepository;
    28     private final BCryptPasswordEncoder bCryptPasswordEncoder;
    29 
    3026    private final BusinessRepository businessRepository;
    3127
     
    3329    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    3430        Stakeholder user = stakeholderRepository.findStakeholderByUsername(username);
    35         if(user == null) {
     31        if (user == null) {
    3632            throw new UsernameNotFoundException("Non existing user");
    3733        }
    3834
    39         if(user.getStakeholderType() == StakeholderType.BUSINESS_OWNER) {
     35        if (user.getStakeholderType() == StakeholderType.BUSINESS_OWNER) {
    4036            Business business = businessRepository.findBusinessByOwner(user);
    4137            if (business.getBusinessStatus() != BusinessStatus.ACTIVE) {
Note: See TracChangeset for help on using the changeset viewer.