File tree Expand file tree Collapse file tree
server/src/main/java/dev/findfirst/security/oauth2client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic
6060 return signupUser (username , oauth2PlaceholderEmail );
6161 }
6262 } catch (UnexpectedException | UserNameTakenException | EmailAlreadyRegisteredException e ) {
63- throw new RuntimeException (e .getMessage ());
64- // no-op just return null;
63+ throw new RuntimeException ("signup failed" , e );
6564 }
6665 };
6766
@@ -80,7 +79,8 @@ else if (username != null && !username.isEmpty()) {
8079 throw new RuntimeException ("Error with user signup/signin" );
8180 }
8281
83- int userRole = user .getRole ().getId () != null ? user .getUserId () : 0 ;
82+ Integer roleId = user .getRole ().getId ();
83+ int userRole = roleId != null ? roleId : 0 ;
8484
8585 GrantedAuthority authority = new SimpleGrantedAuthority (URole .values ()[userRole ].toString ());
8686 String userNameAttributeName = userRequest .getClientRegistration ().getProviderDetails ()
You can’t perform that action at this time.
0 commit comments