Open
Description
I added @elysiajs/jwt ^1.0.2
to my project and initialised it with the .use
hook. Everything seems to work fine however it breaks the type inference causing the handler method parameters to implicitly return a type of any.
app.use(jwt({
secret: env.JWT_SECRET,
algorithms: ["HS256"],
maxAge: "1d",
clockTolerance: 0
}))
.get("/", async ({query, jwt, set, cookie: { auth }}) => {
const verified = await jwt.verify(auth.value)
if (!verified) {
set.status = 401
return 'Unauthorized'
}
const users = await AuthenticationController.all(query);
return ApiResponse.success(users);
},
{
detail: { tags: ["Authentication"] }
}
)
jwt
, query
, set
, and auth
now implicitly have the type of any
Metadata
Metadata
Assignees
Labels
No labels