feat: protect learning pages and rebuild cockpit
This commit is contained in:
@@ -14,6 +14,8 @@ import java.util.Map;
|
||||
@Component
|
||||
public class LearningJwtUtil {
|
||||
|
||||
public static final String AUTH_COOKIE_NAME = "learning_demo_token";
|
||||
|
||||
@Value("${learning.auth.jwt.secret}")
|
||||
private String secret;
|
||||
|
||||
@@ -52,6 +54,10 @@ public class LearningJwtUtil {
|
||||
return Map.copyOf(parse(token));
|
||||
}
|
||||
|
||||
public long expirationMillis() {
|
||||
return expiration;
|
||||
}
|
||||
|
||||
private Claims parse(String token) {
|
||||
return Jwts.parser().verifyWith(key()).build().parseSignedClaims(token).getPayload();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user