We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e2cd21 commit e8944b7Copy full SHA for e8944b7
polling-app-server/src/main/java/com/example/polls/security/JwtTokenProvider.java
@@ -25,13 +25,13 @@ public class JwtTokenProvider {
25
26
public String generateToken(Authentication authentication) {
27
28
- UserPrincipal userDetails = (UserPrincipal) authentication.getPrincipal();
+ UserPrincipal userPrincipal = (UserPrincipal) authentication.getPrincipal();
29
30
Date now = new Date();
31
Date expiryDate = new Date(now.getTime() + jwtExpirationInMs);
32
33
return Jwts.builder()
34
- .setSubject(Long.toString(userDetails.getId()))
+ .setSubject(Long.toString(userPrincipal.getId()))
35
.setIssuedAt(new Date())
36
.setExpiration(expiryDate)
37
.signWith(SignatureAlgorithm.HS512, jwtSecret)
0 commit comments