Using functions for setting times on tokens

This commit is contained in:
2025-04-07 13:11:49 -04:00
parent 713108aa6d
commit f9aaa2970f

View File

@@ -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(),