You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): make AuthManager.verifyToken usable from custom Hono routes (#814) (#819)
AuthManager.verifyToken(token) silently fell back to a dev-only placeholder
secret when called without the JWT_SECRET argument. Custom routes mounted
alongside SonicJS that copy-pasted the docs hit this and rejected every
request as "Invalid token".
- Add AuthManager.verifyAuthRequest(c) helper that pulls the token from the
Authorization header / auth_token cookie and JWT_SECRET from c.env, so
custom Hono routes have a one-call equivalent of requireAuth().
- Strengthen verifyToken JSDoc to spell out the secret requirement and point
to verifyAuthRequest / requireAuth() as the recommended paths.
- Update docs/authentication.md with a "Custom Routes Alongside SonicJS"
section walking through the three supported patterns; fix verifyToken
examples in routing-middleware.md, architecture.md, and the AI API
reference to pass c.env.JWT_SECRET.
- Drive-by: rename destructured `is_active` to `_isActive` in the otp-login
plugin to clear a pre-existing eslint naming-convention error that was
blocking the pre-commit hook.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments