Using functions for setting times on tokens
This commit is contained in:
@@ -56,6 +56,8 @@ pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::Jos
|
||||
provided_key.to_owned()
|
||||
};
|
||||
|
||||
let duration = expire - time::OffsetDateTime::UNIX_EPOCH;
|
||||
|
||||
let signer = Hs256.signer_from_bytes(key.as_bytes()).unwrap();
|
||||
Ok((
|
||||
josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(),
|
||||
|
Reference in New Issue
Block a user