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

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

See https://github.com/Keats/jsonwebtoken/blob/d8a33def00a61bab12aa5e94ff76d3043d4d474e/README.md?plain=1#L61
This commit is contained in:
frobiac
2022-02-15 21:43:31 +00:00
committed by GitHub
parent 8b551dcbf2
commit 8c0926ee5b
+2 -1
View File
@@ -93,7 +93,8 @@ async fn authorize(Json(payload): Json<AuthPayload>) -> Result<Json<AuthBody>, A
let claims = Claims {
sub: "[email protected]".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)