-
How to use JWT with secrets via Cloudflare? This question is originated by #756 |
Beta Was this translation helpful? Give feedback.
Answered by
yusukebe
Jan 12, 2023
Replies: 2 comments
-
We can write the following way: type Bindings = {
JWT_TOKEN_KEY: string
}
const app = new Hono<{ Bindings: Bindings }>()
app.use('/*', async (c, next) => {
const jwtMiddleware = jwt({
secret: c.env.JWT_TOKEN_KEY,
})
return jwtMiddleware(c, next)
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yusukebe
-
How to access wrangler secrets in Hono and also how to access cloudflare worker Variables and Secrets and use that in Hono when deploying ? Thanks in advance ! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can write the following way: