File tree 2 files changed +3
-11
lines changed
src/main/java/org/jenkinsci/plugins
2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -504,9 +504,6 @@ private GHMyself loadMyself(@NonNull String token) throws IOException {
504
504
// Also stick into usersByIdCache (to have latest copy)
505
505
String username = ghMyself .getLogin ();
506
506
usersByIdCache .put (username , new GithubUser (ghMyself ));
507
- } else {
508
- // force creation of the gh variable, esp. in case of impersonation
509
- getGitHub ();
510
507
}
511
508
} catch (IOException e ) {
512
509
LOGGER .log (Level .INFO , e .getMessage (), e );
Original file line number Diff line number Diff line change @@ -753,15 +753,10 @@ public int hashCode() {
753
753
@ Override
754
754
public GroupDetails loadGroupByGroupname (String groupName )
755
755
throws UsernameNotFoundException , DataAccessException {
756
- Authentication authentication = SecurityContextHolder .getContext ().getAuthentication ();
757
- if (authentication == null ) {
758
- throw new UsernameNotFoundException ("No known group: " + groupName );
759
- }
760
- if (!(authentication instanceof GithubAuthenticationToken )) {
761
- throw new UserMayOrMayNotExistException ("The received token is not a GitHub one" );
762
- }
756
+ GithubAuthenticationToken authToken = (GithubAuthenticationToken ) SecurityContextHolder .getContext ().getAuthentication ();
763
757
764
- GithubAuthenticationToken authToken = (GithubAuthenticationToken ) authentication ;
758
+ if (authToken == null )
759
+ throw new UsernameNotFoundException ("No known group: " + groupName );
765
760
766
761
try {
767
762
int idx = groupName .indexOf (GithubOAuthGroupDetails .ORG_TEAM_SEPARATOR );
You can’t perform that action at this time.
0 commit comments