Authentication Types
AuthPayload
JWT payload structure returned after token verification.Subject - the user ID from Logto
OAuth scopes granted to the token
Additional claims from the JWT token
AuthContext
Authentication context attached to requests after verification.The authenticated user ID, or
null if not authenticatedWhether the request has a valid authentication token
The full JWT payload if authenticated, otherwise
nullWhether the request is from a guest user (when
allowGuest is enabled)The guest user ID (when in guest mode)
VerifyAuthOptions
Configuration options for token verification.The Logto tenant URL (e.g.,
https://your-tenant.logto.app)The API resource identifier configured in Logto
Name of the cookie containing the JWT token
Required OAuth scope for authorization (e.g.,
"read:users")Allow unauthenticated guest users with guest IDs
Express Types
ExpressRequest
Extended Express request interface with authentication context.Parsed cookies from the request
HTTP headers from the request
Authentication context added by the middleware
ExpressResponse
Express response interface for middleware.Set HTTP status code
Send JSON response
ExpressNext
Express next function type.Next.js Types
NextRequest
Next.js request interface for route handlers and middleware.Cookie accessor for Next.js requests
Header accessor for Next.js requests
NextResponse
Next.js response interface for route handlers.Send JSON response with optional status code