examples(jwt): Claims.exp represents a UTC timestamp (#760)

For the example to work, it should be an epoch value in the future.

See d8a33def00/README.md (L61)
This commit is contained in:
frobiac 2022-02-15 22:43:31 +01:00 committed by GitHub
parent 8b551dcbf2
commit 8c0926ee5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,7 +93,8 @@ async fn authorize(Json(payload): Json<AuthPayload>) -> Result<Json<AuthBody>, A
let claims = Claims {
sub: "b@b.com".to_owned(),
company: "ACME".to_owned(),
exp: 100000,
// Mandatory expiry time as UTC timestamp
exp: 2000000000, // May 2033
};
// Create the authorization token
let token = encode(&Header::default(), &claims, &KEYS.encoding)