fn flash_redirect(&self, ok_redir: impl Into<String>, err_redir: impl Into<String>, cookies: &mut Cookies) -> Result<Redirect, Flash<Redirect>> {
        match self.authenticate() {
            Ok(cooky) => {
                let cid = Self::cookie_id();
                let contents = cooky.store_cookie();
                cookies.add_private(
                    Cookie::build(cid, contents)
                        // .secure(true)
                        .finish()
                );
                Ok(Redirect::to(ok_redir.into()))
            },
            Err(fail) => {
                let mut furl = err_redir.into();
                if &fail.user != "" {
                    let furl_qrystr = Self::fail_url(&fail.user);
                    furl.push_str(&furl_qrystr);
                }
                Err( Flash::error(Redirect::to(furl), &fail.msg) )
            },
        }
    }
/// Define a custom flash_redirect() method that overrides the default
/// implementation in authorization::AuthorizeForm trait.
/// This allows the cookie to be made secure
Define a custom flash_redirect() method that overrides the default
implementation in authorization::AuthorizeForm trait.
This allows the cookie to be made secure
Define a custom flash_redirect () method that overrides the default implementation in authorization :: AuthorizeForm trait . This allows the cookie to be made secure
fn flash_redirect(&self, ok_redir: impl Into<String>, err_redir: impl Into<String>, cookies: &mut Cookies) -> Result<Redirect, Flash<Redirect>> {
        match self.authenticate() {
            Ok(cooky) => {
                let cid = Self::cookie_id();
                let contents = cooky.store_cookie();
                cookies.add_private(
                    Cookie::build(cid, contents)
                        // .secure(true)
                        .finish()
                );
                Ok(Redirect::to(ok_redir.into()))
            },
            Err(fail) => {
                let mut furl = err_redir.into();
                if &fail.user != "" {
                    let furl_qrystr = Self::fail_url(&fail.user);
                    furl.push_str(&furl_qrystr);
                }
                Err( Flash::error(Redirect::to(furl), &fail.msg) )
            },
        }
    }
fn flash_redirect ( & self , ok_redir : impl Into < String > , err_redir : impl Into < String > , cookies : & mut Cookies ) -> Result < Redirect , Flash < Redirect > > { match self . authenticate ( ) { Ok ( cooky ) => { let cid = Self :: cookie_id ( ) ; let contents = cooky . store_cookie ( ) ; cookies . add_private ( Cookie :: build ( cid , contents ) // .secure(true) . finish ( ) ) ; Ok ( Redirect :: to ( ok_redir . into ( ) ) ) } , Err ( fail ) => { let mut furl = err_redir . into ( ) ; if & fail . user != " " { let furl_qrystr = Self :: fail_url ( & fail . user ) ; furl . push_str ( & furl_qrystr ) ; } Err ( Flash :: error ( Redirect :: to ( furl ) , & fail . msg ) ) } , } }
Define a custom flash_redirect() method that overrides the default
implementation in authorization::AuthorizeForm trait.
Define a custom flash_redirect () method that overrides the default implementation in authorization :: AuthorizeForm trait .
&self
ok_redir
impl Into<String>
err_redir
impl Into<String>
cookies
&mut Cookies
&self
ok_redir
impl Into<String>
err_redir
impl Into<String>
cookies
&mut Cookies