Skip to content

Commit a48ef18

Browse files
authored
test: support alg option for JWT middleware (#4624)
1 parent cc0aa7a commit a48ef18

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

runtime-tests/bun/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('Serve Static Middleware', () => {
175175
// So, JWT middleware works well.
176176
describe('JWT Auth Middleware', () => {
177177
const app = new Hono()
178-
app.use('/jwt/*', jwt({ secret: 'a-secret' }))
178+
app.use('/jwt/*', jwt({ secret: 'a-secret', alg: 'HS256' }))
179179
app.get('/jwt/a', (c) => c.text('auth'))
180180

181181
it('Should not authorize, return 401 Response', async () => {

runtime-tests/deno/middleware.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Deno.test('JWT Authentication middleware', async () => {
163163
await next()
164164
c.header('x-foo', c.get('x-foo') || '')
165165
})
166-
app.use('/auth/*', jwt({ secret: 'a-secret' }))
166+
app.use('/auth/*', jwt({ secret: 'a-secret', alg: 'HS256' }))
167167
app.get('/auth/*', (c) => {
168168
c.set('x-foo', 'bar')
169169
return new Response('auth')

runtime-tests/node/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('Basic Auth Middleware', () => {
8181
describe('JWT Auth Middleware', () => {
8282
const app = new Hono()
8383

84-
app.use('/jwt/*', jwt({ secret: 'a-secret' }))
84+
app.use('/jwt/*', jwt({ secret: 'a-secret', alg: 'HS256' }))
8585
app.get('/jwt/a', (c) => c.text('auth'))
8686

8787
const agent = createAgent(app)

0 commit comments

Comments
 (0)