3535//! web::HttpResponse::Ok().finish()
3636//! }
3737//!
38- //! let app = web::App::new().wrap (IdentityService::new(
38+ //! let app = web::App::new().middleware (IdentityService::new(
3939//! // <- create identity middleware
4040//! CookieIdentityPolicy::new(&[0; 32]) // <- create cookie identity policy
4141//! .name("auth-cookie")
@@ -195,7 +195,7 @@ pub trait IdentityPolicy<Err>: Sized + 'static {
195195/// use ntex::web::App;
196196/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
197197///
198- /// let app = App::new().wrap (IdentityService::new(
198+ /// let app = App::new().middleware (IdentityService::new(
199199/// // <- create identity middleware
200200/// CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
201201/// .name("auth-cookie")
@@ -419,7 +419,7 @@ impl CookieIdentityInner {
419419/// use ntex::web::App;
420420/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
421421///
422- /// let app = App::new().wrap (IdentityService::new(
422+ /// let app = App::new().middleware (IdentityService::new(
423423/// // <- create identity middleware
424424/// CookieIdentityPolicy::new(&[0; 32]) // <- construct cookie policy
425425/// .domain("www.rust-lang.org")
@@ -578,7 +578,7 @@ mod tests {
578578 async fn test_identity ( ) {
579579 let srv = test:: init_service (
580580 App :: new ( )
581- . wrap ( IdentityService :: new (
581+ . middleware ( IdentityService :: new (
582582 CookieIdentityPolicy :: new ( & COOKIE_KEY_MASTER )
583583 . domain ( "www.rust-lang.org" )
584584 . name ( COOKIE_NAME )
@@ -635,7 +635,7 @@ mod tests {
635635 let duration = Duration :: days ( 1 ) ;
636636 let srv = test:: init_service (
637637 App :: new ( )
638- . wrap ( IdentityService :: new (
638+ . middleware ( IdentityService :: new (
639639 CookieIdentityPolicy :: new ( & COOKIE_KEY_MASTER )
640640 . domain ( "www.rust-lang.org" )
641641 . name ( COOKIE_NAME )
@@ -661,7 +661,7 @@ mod tests {
661661 let seconds = 60 ;
662662 let srv = test:: init_service (
663663 App :: new ( )
664- . wrap ( IdentityService :: new (
664+ . middleware ( IdentityService :: new (
665665 CookieIdentityPolicy :: new ( & COOKIE_KEY_MASTER )
666666 . domain ( "www.rust-lang.org" )
667667 . name ( COOKIE_NAME )
@@ -691,9 +691,11 @@ mod tests {
691691 > {
692692 test:: init_service (
693693 App :: new ( )
694- . wrap ( IdentityService :: new ( f ( CookieIdentityPolicy :: new ( & COOKIE_KEY_MASTER )
695- . secure ( false )
696- . name ( COOKIE_NAME ) ) ) )
694+ . middleware ( IdentityService :: new ( f ( CookieIdentityPolicy :: new (
695+ & COOKIE_KEY_MASTER ,
696+ )
697+ . secure ( false )
698+ . name ( COOKIE_NAME ) ) ) )
697699 . service ( web:: resource ( "/" ) . to ( |id : Identity | async move {
698700 let identity = id. identity ( ) ;
699701 if identity. is_none ( ) {
0 commit comments