elysiajs / elysia-jwt

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

schema: t.String() error #39

Open K4leri opened 3 months ago

K4leri commented 3 months ago

изображение

export const jwtMessaging2 = new Elysia()
.use(
  jwt({
    name: "jwtMessaging",
    schema: t.String(),
    secret: "wkihfijbwnijoenfiwb euifbui23g89rg82g38r bdui293neruer 23u9br8ui923h8i",
    exp: '2h',
  })
);
export const messageEncrypt2 = (app: Elysia) =>
  app
    .use(jwtMessaging)
    .guard({response: t.String()})
    .onAfterHandle(async ({ jwtMessaging, response }) => {
        const payloadMessage = await jwtMessaging.sign(response);
        return payloadMessage;
    })

Hi! For some reason i cannt make schema that should be only as string. Its not correct or its a bug ? @elysiajs/jwt": "^1.0.2"