auth-service complete, app full work

This commit is contained in:
roma-dxunvrs
2026-04-11 20:26:14 +03:00
parent 2f4846e20d
commit 1356bd2509
23 changed files with 197 additions and 188 deletions
@@ -10,7 +10,7 @@ import java.util.Date;
@Service
public class JwtService {
private final PrivateKey privateKey;
private final long expirationTime = 1000 * 60 * 15; // 15 минут
private final long expirationTime = 1000 * 60 * 5; // 15 минут
public JwtService(JwtKeyProvider keyProvider) {
this.privateKey = keyProvider.getPrivateKey();
@@ -18,8 +18,8 @@ public class JwtService {
public String generateToken(int userId, String username) {
return Jwts.builder()
.subject(username)
.claim("userId", userId)
.subject(String.valueOf(userId))
.claim("username", username)
.issuedAt(new Date())
.expiration(new Date(System.currentTimeMillis() + expirationTime))
.signWith(privateKey, Jwts.SIG.RS256)