Skip to content
Myr

test: support `alg` option for JWT middleware (#4624)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent cc0aa7a · Browse files · 3 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+3 added−3 removed

  • tests:+3 added−3 removed

3 files+3 added−3 removed

modified:runtime-tests/bun/index.test.tsx+1 added-1 removed
173 unmodified lines
174// Bun support WebCrypto since v0.2.2175// So, JWT middleware works well.176describe('JWT Auth Middleware', () => {177 const app = new Hono()178 app.use('/jwt/*', jwt({ secret: 'a-secret' }))178 app.use('/jwt/*', jwt({ secret: 'a-secret', alg: 'HS256' }))179 app.get('/jwt/a', (c) => c.text('auth'))180181 it('Should not authorize, return 401 Response', async () => {182 const req = new Request('http://localhost/jwt/a')
272 unmodified lines
modified:runtime-tests/deno/middleware.test.tsx+1 added-1 removed
modified:runtime-tests/node/index.test.ts+1 added-1 removed
79 unmodified lines
8081describe('JWT Auth Middleware', () => {82 const app = new Hono()8384 app.use('/jwt/*', jwt({ secret: 'a-secret' }))84 app.use('/jwt/*', jwt({ secret: 'a-secret', alg: 'HS256' }))85 app.get('/jwt/a', (c) => c.text('auth'))8687 const agent = createAgent(app)88
213 unmodified lines