Merge factors type for authentication
This commit is contained in:
@@ -27,8 +27,9 @@ pub struct JWTSigner(RS256KeyPair);
|
||||
|
||||
impl JWTSigner {
|
||||
pub fn gen_from_memory() -> Res<Self> {
|
||||
Ok(Self(RS256KeyPair::generate(2048)?
|
||||
.with_key_id(&format!("key-{}", rand_str(15)))))
|
||||
Ok(Self(
|
||||
RS256KeyPair::generate(2048)?.with_key_id(&format!("key-{}", rand_str(15))),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn get_json_web_key(&self) -> JsonWebKey {
|
||||
@@ -45,4 +46,4 @@ impl JWTSigner {
|
||||
pub fn sign_token<E: Serialize + DeserializeOwned>(&self, c: JWTClaims<E>) -> Res<String> {
|
||||
Ok(self.0.sign(c)?)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user