/// Save a CSRF token linked to the remote IP of the Http Request that created it.
Save a CSRF token linked to the remote IP of the Http Request that created it.
Save a CSRF token linked to the remote IP of the Http Request that created it .
pub fn save(
    idp_name: &'static str,
    req: &HttpRequest,
    token: CsrfToken,
) -> Result<(), TelescopeError> {
    // Get the remote IP address string.
    let ip_addr: String = extract_ip_addr(req)?;
    // Get the current time and add the expiration duration (10 minutes) to get the
    // expiration time.
    let expiration_time: DateTime<Utc> = Utc::now() + Duration::minutes(10);
    // Save the IP Address to the CSRF map and return OK.
    global_csrf_map().insert((idp_name, ip_addr), (token, expiration_time));
    return Ok(());
}
pub fn save ( idp_name : & ' static str , req : & HttpRequest , token : CsrfToken , ) -> Result < ( ) , TelescopeError > { // Get the remote IP address string. let ip_addr : String = extract_ip_addr ( req ) ? ; // Get the current time and add the expiration duration (10 minutes) to get the // expiration time. let expiration_time : DateTime < Utc > = Utc :: now ( ) + Duration :: minutes ( 10 ) ; // Save the IP Address to the CSRF map and return OK. global_csrf_map ( ) . insert ( ( idp_name , ip_addr ) , ( token , expiration_time ) ) ; return Ok ( ( ) ) ; }
Save a CSRF token linked to the remote IP of the Http Request that created it.
Save a CSRF token linked to the remote IP of the Http Request that created it .
idp_name
&'static str
req
&HttpRequest
token
CsrfToken