Skip to content

Adds an option for enabling JWT auth to the gateway#3

Draft
cameronvoell wants to merge 2 commits into
xmtp:mainfrom
cameronvoell:jwt-auth
Draft

Adds an option for enabling JWT auth to the gateway#3
cameronvoell wants to merge 2 commits into
xmtp:mainfrom
cameronvoell:jwt-auth

Conversation

@cameronvoell

@cameronvoell cameronvoell commented Jan 8, 2026

Copy link
Copy Markdown

Remaining:

  • Update README.md with steps for testing JWT authentication

Comment on lines +59 to +64
if time.Now().After(claims.ExpiresAt.Time) {
return gateway.Identity{}, gateway.NewPermissionDeniedError(
"token expired",
ErrTokenExpired,
)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exp check after jwt.ParseWithClaims is redundant and can mislabel other validation errors as expiration. Consider removing the post-parse ExpiresAt check; jwt.WithExpirationRequired() already validates it.

-        if time.Now().After(claims.ExpiresAt.Time) {
-            return gateway.Identity{}, gateway.NewPermissionDeniedError(
-                "token expired",
-                ErrTokenExpired,
-            )
-        }

🚀 Want me to fix this? Reply ex: "fix it for me".

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