JWT token username update

This commit is contained in:
MathewFrancis 2025-05-15 14:58:04 +05:30
parent 564d80212a
commit 8cdb4aec20
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ public class CustomAuthenticationProviderForCezen implements AuthenticationProvi
return null;
}
return new UsernamePasswordAuthenticationToken(user, pwd, authorities);
return new UsernamePasswordAuthenticationToken(user.getUserName(), pwd, authorities);
} else {
throw new BadCredentialsException("Invalid password!");
}

View File

@ -27,7 +27,7 @@ public class JWTTokenGeneratorFilter extends OncePerRequestFilter {
//at this point the user is authenticated we just have to send the token back
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
System.out.println(authentication);
System.out.println(authentication.getName()+" Is the name ");
if (null != authentication) {
//get the JWT key from the contents we defined