pub struct JwtConfig {
pub secret: String,
pub access_token_ttl_secs: i64,
pub refresh_token_ttl_secs: i64,
pub cookie_domain: Option<String>,
pub cookie_secure: bool,
}Expand description
JWT configuration.
§Examples
use ironflow_auth::jwt::JwtConfig;
let config = JwtConfig {
secret: "my-secret-key".to_string(),
access_token_ttl_secs: 900,
refresh_token_ttl_secs: 604800,
cookie_domain: None,
cookie_secure: false,
};Fields§
§secret: StringHMAC secret for signing tokens.
access_token_ttl_secs: i64Access token time-to-live in seconds (default: 900 = 15 min).
refresh_token_ttl_secs: i64Refresh token time-to-live in seconds (default: 604800 = 7 days).
Optional cookie domain (e.g., .example.com).
Whether to set the Secure flag on cookies.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JwtConfig
impl RefUnwindSafe for JwtConfig
impl Send for JwtConfig
impl Sync for JwtConfig
impl Unpin for JwtConfig
impl UnsafeUnpin for JwtConfig
impl UnwindSafe for JwtConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more