Skip to content

Commit d2a7c33

Browse files
committed
chore: add exp/iat to jwt token
1 parent a5d9e5c commit d2a7c33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/spp/cli/PlatformCLI.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ object PlatformCLI : CliktCommand(name = "spp-cli", allowMultipleSubcommands = t
125125
accessToken = JWT.create()
126126
.withIssuer("cli")
127127
.withClaim("developer_id", "system") //users with key are automatically considered system
128-
.withClaim("created_at", Instant.now().toEpochMilli())
129128
//todo: reasonable exp
130-
.withClaim("exp", Instant.now().plus(30, ChronoUnit.DAYS).toEpochMilli())
129+
.withClaim("exp", Instant.now().plus(30, ChronoUnit.DAYS).epochSecond)
130+
.withClaim("iat", Instant.now().epochSecond)
131131
.sign(algorithm)
132132
} else if (accessToken == null) {
133133
val tokenUri = "$serverUrl/api/new-token?authorization_code=$authorizationCode"

0 commit comments

Comments
 (0)