mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] UTC Clock
This commit is contained in:
parent
736bf51eaa
commit
f6ee175acd
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
import java.security.interfaces.ECPrivateKey;
|
import java.security.interfaces.ECPrivateKey;
|
||||||
import java.security.interfaces.ECPublicKey;
|
import java.security.interfaces.ECPublicKey;
|
||||||
|
import java.time.Clock;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
|
@ -27,6 +28,7 @@ public static String makeAccessJwtTokenFromString(User user, LocalDateTime expir
|
||||||
public static JwtTokenInfo getJwtInfoFromAccessToken(String token, ECPublicKey publicKey) {
|
public static JwtTokenInfo getJwtInfoFromAccessToken(String token, ECPublicKey publicKey) {
|
||||||
var parser = Jwts.parserBuilder()
|
var parser = Jwts.parserBuilder()
|
||||||
.requireIssuer("LaunchServer")
|
.requireIssuer("LaunchServer")
|
||||||
|
.setClock(() -> new Date(Clock.systemUTC().millis()))
|
||||||
.setSigningKey(publicKey)
|
.setSigningKey(publicKey)
|
||||||
.build();
|
.build();
|
||||||
var claims = parser.parseClaimsJws(token);
|
var claims = parser.parseClaimsJws(token);
|
||||||
|
|
Loading…
Reference in a new issue