Skip to content

Conversation

@bakcxoj
Copy link
Contributor

@bakcxoj bakcxoj 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

@Keats Keats merged commit d4f3300 into Keats:master Nov 7, 2023
@bakcxoj bakcxoj 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