diff --git a/CHANGES.md b/CHANGES.md index 003d7721f..08a60d33f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,8 @@ * Extend `Responder` trait, allow to override status code and headers. +* Store visit and login timestamp in the identity cookie #502 + ### Changed * `.to_async()` handler can return `Responder` type #792 diff --git a/src/middleware/identity.rs b/src/middleware/identity.rs index 5e46bda26..65b5309b7 100644 --- a/src/middleware/identity.rs +++ b/src/middleware/identity.rs @@ -512,12 +512,16 @@ impl CookieIdentityPolicy { } /// Accepts only users whose cookie has been seen before the given deadline + /// + /// By default visit deadline is disabled. pub fn visit_deadline(mut self, value: Duration) -> CookieIdentityPolicy { Rc::get_mut(&mut self.0).unwrap().visit_deadline = Some(value); self } /// Accepts only users which has been authenticated before the given deadline + /// + /// By default login deadline is disabled. pub fn login_deadline(mut self, value: Duration) -> CookieIdentityPolicy { Rc::get_mut(&mut self.0).unwrap().login_deadline = Some(value); self