Skip to content

Commit e8944b7

Browse files
author
Rajeev Kumar Singh
committed
cleanup
1 parent 6e2cd21 commit e8944b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

polling-app-server/src/main/java/com/example/polls/security/JwtTokenProvider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public class JwtTokenProvider {
2525

2626
public String generateToken(Authentication authentication) {
2727

28-
UserPrincipal userDetails = (UserPrincipal) authentication.getPrincipal();
28+
UserPrincipal userPrincipal = (UserPrincipal) authentication.getPrincipal();
2929

3030
Date now = new Date();
3131
Date expiryDate = new Date(now.getTime() + jwtExpirationInMs);
3232

3333
return Jwts.builder()
34-
.setSubject(Long.toString(userDetails.getId()))
34+
.setSubject(Long.toString(userPrincipal.getId()))
3535
.setIssuedAt(new Date())
3636
.setExpiration(expiryDate)
3737
.signWith(SignatureAlgorithm.HS512, jwtSecret)

0 commit comments

Comments
 (0)