Skip to content

chore: Simplify current-time lookup in AbstractToken#isExpired#1992

Open
NiklasHerrmann21 wants to merge 1 commit into
mainfrom
chore/simplify-token-expiry-check
Open

chore: Simplify current-time lookup in AbstractToken#isExpired#1992
NiklasHerrmann21 wants to merge 1 commit into
mainfrom
chore/simplify-token-expiry-check

Conversation

@NiklasHerrmann21

Copy link
Copy Markdown
Contributor

Use `Instant.now()` directly in `AbstractToken#isExpired()` instead of
`LocalDateTime.now().toInstant(ZoneOffset.UTC)`. Same logical result with
one type and two imports fewer.

`getExpiration()` already returns an `Instant` derived from
`Instant.ofEpochSecond(...)`, so comparing against `Instant.now()` is the
natural fit.

Use Instant.now() directly instead of converting LocalDateTime.now() via
ZoneOffset.UTC. Same logical result, fewer intermediate types, fewer
imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant