Skip to content

Commit

Permalink
Fix commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdt committed Nov 12, 2024
1 parent 1525d25 commit f56c6fb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/client-api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ impl TokenClaims {

pub fn encode_and_sign_with_expiry(
&self,
// private_key: &EncodingKey,
signer: &impl TokenSigner,
expiry: Option<Duration>,
) -> Result<String, JwtError> {
Expand Down Expand Up @@ -186,15 +185,12 @@ impl SpacetimeAuth {
)
}

pub fn re_sign_with_expiry(&self, signer: &impl TokenSigner, expiry: Duration) -> Result<String, JwtError> {
TokenClaims::from(self.clone()).encode_and_sign_with_expiry(signer, Some(expiry))
}
// Sign a new token with the same claims and a new expiry.
// Note that this will not change the issuer, so the private_key might not match.
// We do this to create short-lived tokens that we will be able to verify.
// pub fn re_sign_with_expiry(&self, private_key: &EncodingKey, expiry: Duration) -> Result<String, JwtError> {
// TokenClaims::from(self.clone()).encode_and_sign_with_expiry(private_key, Some(expiry))
// }
pub fn re_sign_with_expiry(&self, signer: &impl TokenSigner, expiry: Duration) -> Result<String, JwtError> {
TokenClaims::from(self.clone()).encode_and_sign_with_expiry(signer, Some(expiry))
}
}

// JwtAuthProvider is used for signing and verifying JWT tokens.
Expand Down

0 comments on commit f56c6fb

Please sign in to comment.