What problem does it solve?
Designing, implementing, or refactoring authentication and authorization in Hono + TypeScript backends, including JWT, sessions/cookies, middleware, and role-based patterns, can be complex and security-critical. This Skill automates the setup of robust auth flows and secure route protection, ensuring consistent and reliable access control.
Core Features & Use Cases
- JWT-Based Auth Flows: Implement JWT access tokens (and optional refresh tokens) using
jose for stateless API authentication across various runtimes.
- Auth Middleware & Route Protection: Add auth middleware to extract, verify tokens, and attach user information to
c.var for protected routes.
- Role-Based Authorization: Implement helper middleware for role/permission checks, enabling fine-grained access control per route or route group.
Quick Start
Add auth to this Hono API, protecting routes with JWT, implementing login/signup endpoints, and checking roles on these Hono routes.