elysiajs / elysia-jwt

Plugin for Elysia for using JWT Authentication
MIT License
38 stars 16 forks source link

Cant verify JWT for no reason #38

Closed K4leri closed 3 months ago

K4leri commented 3 months ago
export const jwtAccessSetup = new Elysia()
.use(
  jwt({
    name: "jwtAccess",
    schema: t.Object({
        id: t.String(),
        role: t.String(),
        // ban: t.Boolean()
    }),
    secret: "I_have_many_random_words",
    exp: '1d',
  })
);
const accessToken = await jwtAccess.sign({ id: user.id, role: user.role || "user"})
const payload = await jwtAccess.verify(accessToken);
console.log(payload) => false

@elysiajs/jwt": "^1.0.2 Hi. My libriry was broken for some reason. I create jwt and immediately trying verify it and get false .. изображение

is their any suggestions what i can do ? cause all authorization proccess is down right now

Jayke770 commented 2 weeks ago

same issue