honojs / middleware

monorepo for Hono third-party middleware/helpers/wrappers
https://hono.dev
396 stars 138 forks source link

@hono/clerk-auth empty response when JWT is expired #450

Open mariusbolik opened 4 months ago

mariusbolik commented 4 months ago

Hello,

I am using the @hono/clerk-auth package in my project. It works very well so far.

This is my code:

app.use('/payment/*', clerkMiddleware())

app.post('/payment/billing', (c) => {
  const auth = getAuth(c)

  console.log('auth', auth) 

  if (!auth?.userId) {
    return c.json({
      message: 'You are not logged in.',
    })
  }

  return c.json({
    message: 'You are logged in!',
    user: auth,
  })
})

Kind regards, Marius

MonsterDeveloper commented 4 months ago

@mariusbolik the upgraded version of the middleware that uses Clerk Core v2 is now available. Could you please update and confirm the issue persists with the new version?