Skip to content
New issue

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

Do what chrono does #341

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Do what chrono does #341

merged 2 commits into from
Nov 7, 2023

Conversation

BrandonDyer64
Copy link
Contributor

@BrandonDyer64 BrandonDyer64 commented Oct 29, 2023

resolves #339

I really don't like this approach though.

Why is setting the expiration time user controlled, but not validation? I have to import chrono so I can specify a timestamp for exp, but then the validation call is a black box that does something outside of user control. IMO, there shouldn't be a get_current_timestamp call. The user should have to supply one on calling decode, the same way they do when calling encode

@Keats
Copy link
Owner

Keats commented Oct 29, 2023

IMO, there shouldn't be a get_current_timestamp call. The user should have to supply one on calling decode, the same way they do when calling encode

That would be horrendous UX. Is there a single JWT library in any languages doing that by default? I can potentially image having it to override the current timestamp for testing purposes but it's present in many languages. I've checked node, python, ruby and .net and only node allows setting it for decode.

Getting the current timestamp has nothing to do with validation

Cargo.toml Show resolved Hide resolved
@Keats Keats merged commit d4f3300 into Keats:master Nov 7, 2023
5 checks passed
@BrandonDyer64 BrandonDyer64 deleted the wasm-support branch November 19, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decode panics on wasm32-unknown-unknown when validate_exp is true
2 participants