We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey, below is the function am using for issuing a token and later when I try to verify the token immediately, I get false.
false
I tried HS256, HS512 algorithms, same issue. surprisingly, verify works if I don't pass nbf and exp whilst issuing.
verify
nbf
exp
import jwt from "@tsndr/cloudflare-worker-jwt" const issueToken = async (payload: any, secret: string) => { return await jwt.sign({ ...payload, nbf: Math.floor(Date.now() / 1000) + (60 * 60), // Not before: Now + 1h exp: Math.floor(Date.now() / 1000) + (2 * (60 * 60)) // Expires: Now + 2h }, secret) }
Thank you again for this library :)
The text was updated successfully, but these errors were encountered:
Because the token will be valid in an hour from now (see: #30)
Sorry, something went wrong.
No branches or pull requests
Hey, below is the function am using for issuing a token and later when I try to verify the token immediately, I get
false
.I tried HS256, HS512 algorithms, same issue. surprisingly,
verify
works if I don't passnbf
andexp
whilst issuing.Thank you again for this library :)
The text was updated successfully, but these errors were encountered: