Browse Source
Merge pull request #10758 from YevhenBondarenko/fix/jjwt-generate-report
Jwt token factory refactored due to PE
pull/10787/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java
|
|
|
@ -210,11 +210,12 @@ public class JwtTokenFactory { |
|
|
|
|
|
|
|
ZonedDateTime currentTime = ZonedDateTime.now(); |
|
|
|
|
|
|
|
claimsBuilder.expiration(Date.from(currentTime.plusSeconds(expirationTime).toInstant())); |
|
|
|
|
|
|
|
return Jwts.builder() |
|
|
|
.claims(claimsBuilder.build()) |
|
|
|
.issuer(jwtSettingsService.getJwtSettings().getTokenIssuer()) |
|
|
|
.issuedAt(Date.from(currentTime.toInstant())) |
|
|
|
.expiration(Date.from(currentTime.plusSeconds(expirationTime).toInstant())) |
|
|
|
.signWith(getSecretKey(false), Jwts.SIG.HS512); |
|
|
|
} |
|
|
|
|
|
|
|
|