rscarrera27 / Sanic-JWT-Extended

⚡️An open source Sanic extension that provides "extended" JWT support
https://sanic-jwt-extended.seonghyeon.dev
MIT License
35 stars 8 forks source link

There maybe a bug in create_refresh_token when store private_claims #32

Open beruhan opened 3 years ago

beruhan commented 3 years ago

I create refresh token with private_claims,like this {"username":"test"},After refreshing token,I found the private_claims's keys has a dot prefix,like this{".username":"test"} The bug code as fllows:

for k, v in private_claims.items():
    payload[f"{private_claim_prefix}.{k}"] = v

Maybe this is correct:

for k, v in private_claims.items():
    payload[private_claim_prefix + k] = v