rrrodzilla / rusty_paseto

A type-driven, ergonomic RUST implementation of the PASETO protocol for secure stateless tokens.
https://crates.io/crates/rusty_paseto
MIT License
68 stars 8 forks source link

Invalid JSON payload when using CustomClaims with T that serialize to an JSON object #39

Closed xbb closed 1 month ago

xbb commented 1 month ago

Describe the bug If you pass a serializable struct to CustomClaims the builder will generate an invalid JSON payload due to the trimming of multiple object delimiters.

The builder will still build a token successfully, but the validation will fail with a JSON error.

See my quick fix attempt here: https://github.com/xbb/rusty_paseto/commit/00b1a9075e94f472e6c48b56f800b571847308e7

rrrodzilla commented 1 month ago

Thanks I'll have a look

rrrodzilla commented 1 month ago

Closing issue #39 as it has been addressed in PR #40 and published to crates.io as v0.7.1. Please refer to the closing notes in the PR for a description of the fix. Credit and thanks to @xbb for reporting the issue and offering a suggestion on the fix.