Code refactoring
All checks were successful
Rust Build / Check (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 55s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 45s
Rust Build / build (pull_request) Successful in 1m12s
All checks were successful
Rust Build / Check (pull_request) Successful in 44s
Rust Build / Test Suite (pull_request) Successful in 55s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 45s
Rust Build / build (pull_request) Successful in 1m12s
This commit is contained in:
@@ -48,11 +48,12 @@ pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::Jos
|
||||
};
|
||||
|
||||
let signer = Hs256.signer_from_bytes(key.as_bytes()).unwrap();
|
||||
Ok((josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(), duration.whole_seconds()))
|
||||
}
|
||||
Err(e) => {
|
||||
Err(josekit::JoseError::InvalidClaim(e.into()))
|
||||
Ok((
|
||||
josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(),
|
||||
duration.whole_seconds(),
|
||||
))
|
||||
}
|
||||
Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user