Closed jakmaz closed 1 month ago
I got the answer in elysiajs discord server.
Message from @bogeychan
you must use .use(jwt())
on all instances where you need the type:
// auth.ts
import { Elysia } from "elysia";
import { jwt } from "@elysiajs/jwt";
export const myJwt = jwt(/* ... */);
export const auth = new Elysia({ name: "auth" })
.use(myJwt)
.get("/auth", ({ jwt }) => "auth");
I am having trouble in using jwt property in routes in different files. Why is jwt not present although using functional callback?
app.ts
auth.ts