File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/java/com/patternknife/securityhelper/oauth2/config/security/serivce/userdetail Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
package com .patternknife .securityhelper .oauth2 .config .security .serivce .userdetail ;
2
2
3
3
4
- import com .patternknife .securityhelper .oauth2 .config .response .error .exception .data .ResourceNotFoundException ;
5
4
import com .patternknife .securityhelper .oauth2 .config .security .dao .OauthClientDetailRepository ;
6
5
import com .patternknife .securityhelper .oauth2 .config .security .principal .AccessTokenUserInfo ;
7
6
import com .patternknife .securityhelper .oauth2 .config .security .principal .AdditionalAccessTokenUserInfo ;
20
19
import org .springframework .security .core .authority .AuthorityUtils ;
21
20
import org .springframework .security .core .userdetails .UserDetails ;
22
21
import org .springframework .security .core .userdetails .UserDetailsService ;
22
+ import org .springframework .security .core .userdetails .UsernameNotFoundException ;
23
23
import org .springframework .stereotype .Service ;
24
24
25
25
import java .util .ArrayList ;
@@ -54,7 +54,7 @@ public void setEntityManager(EntityManager entityManager) {
54
54
@ Override
55
55
public UserDetails loadUserByUsername (String username ){
56
56
57
- Admin admin = adminRepository .findByIdName (username ).orElseThrow (() -> new ResourceNotFoundException ("Admin (ID : \" " + username + "\" ) NOT found." ));
57
+ Admin admin = adminRepository .findByIdName (username ).orElseThrow (() -> new UsernameNotFoundException ("Admin (ID : \" " + username + "\" ) NOT found." ));
58
58
if (admin .getDeletedAt () != null ){
59
59
throw new DisabledException (admin .getIdName () + "'s account is currently disabled." );
60
60
}
Original file line number Diff line number Diff line change 2
2
3
3
4
4
import com .patternknife .securityhelper .oauth2 .config .response .error .exception .auth .UserDeletedException ;
5
- import com .patternknife .securityhelper .oauth2 .config .response .error .exception .data .ResourceNotFoundException ;
6
5
import com .patternknife .securityhelper .oauth2 .config .security .dao .OauthClientDetailRepository ;
7
6
import com .patternknife .securityhelper .oauth2 .config .security .principal .AccessTokenUserInfo ;
8
7
import com .patternknife .securityhelper .oauth2 .config .security .principal .AdditionalAccessTokenUserInfo ;
20
19
import org .springframework .security .core .authority .AuthorityUtils ;
21
20
import org .springframework .security .core .userdetails .UserDetails ;
22
21
import org .springframework .security .core .userdetails .UserDetailsService ;
22
+ import org .springframework .security .core .userdetails .UsernameNotFoundException ;
23
23
import org .springframework .stereotype .Service ;
24
24
25
25
import java .util .ArrayList ;
@@ -54,7 +54,7 @@ public void setEntityManager(EntityManager entityManager) {
54
54
@ Override
55
55
public UserDetails loadUserByUsername (String username ) {
56
56
57
- Customer customer = customerRepository .findByIdName (username ).orElseThrow (() -> new ResourceNotFoundException ("Customer (ID : \" " + username + "\" ) NOT foUND" ));
57
+ Customer customer = customerRepository .findByIdName (username ).orElseThrow (() -> new UsernameNotFoundException ("Customer (ID : \" " + username + "\" ) NOT foUND" ));
58
58
if (customer .getDeletedAt () != null ){
59
59
if (customer .getDeleteAdminId () == null ) {
60
60
if (customer .getOneWeekAfterDeletedAsString () != null ) {
You can’t perform that action at this time.
0 commit comments