Skip to content

Config exp not encoded in payload #101

Closed
@luckysoni

Description

@luckysoni

What version of Elysia is running?

1.3.5

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

@elysiajs/jwt version 1.3.1

The exp in config doesn't get encoded in the token.

const app = new Elysia()
  .use(
    jwt({
      name: "elysiaJwt",
      secret: "123",
      exp: "1h",
    })
  )
  .get("/", async ({ elysiaJwt }) => {
    return await elysiaJwt.sign({ id: "123" });
  })
  .listen(3000);

// Response
eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMyJ9.BVAUaKmfO7ynqbwk-XAUvOoLCXKWSu88DnLACmXbO2E

Image

What is the expected behavior?

The exp from config should be part of the payload.

What do you see instead?

No response

Additional information

No response

Have you try removing the node_modules and bun.lockb and try again yet?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions