fn redirect(&self, ok_redir: &str, err_redir: &str, cookies: &mut Cookies) -> Result<Redirect, Redirect> {
        match self.authenticate() {
            Ok(cooky) => {
                let cid = Self::cookie_id();
                let contents = cooky.store_cookie();
                cookies.add_private(Cookie::new(cid, contents));
                Ok(Redirect::to(ok_redir.to_string()))
            },
            Err(fail) => {
                let mut furl = String::from(err_redir);
                if &fail.user != "" {
                    let furl_qrystr = Self::fail_url(&fail.user);
                    furl.push_str(&furl_qrystr);
                }
                Err( Redirect::to(furl) )
            },
        }
    }
/// Redirect the user to one page on successful authentication or
/// another page if authentication fails.
Redirect the user to one page on successful authentication or
another page if authentication fails.
Redirect the user to one page on successful authentication or another page if authentication fails .
fn redirect(&self, ok_redir: &str, err_redir: &str, cookies: &mut Cookies) -> Result<Redirect, Redirect> {
        match self.authenticate() {
            Ok(cooky) => {
                let cid = Self::cookie_id();
                let contents = cooky.store_cookie();
                cookies.add_private(Cookie::new(cid, contents));
                Ok(Redirect::to(ok_redir.to_string()))
            },
            Err(fail) => {
                let mut furl = String::from(err_redir);
                if &fail.user != "" {
                    let furl_qrystr = Self::fail_url(&fail.user);
                    furl.push_str(&furl_qrystr);
                }
                Err( Redirect::to(furl) )
            },
        }
    }
fn redirect ( & self , ok_redir : & str , err_redir : & str , cookies : & mut Cookies ) -> Result < Redirect , Redirect > { match self . authenticate ( ) { Ok ( cooky ) => { let cid = Self :: cookie_id ( ) ; let contents = cooky . store_cookie ( ) ; cookies . add_private ( Cookie :: new ( cid , contents ) ) ; Ok ( Redirect :: to ( ok_redir . to_string ( ) ) ) } , Err ( fail ) => { let mut furl = String :: from ( err_redir ) ; if & fail . user != " " { let furl_qrystr = Self :: fail_url ( & fail . user ) ; furl . push_str ( & furl_qrystr ) ; } Err ( Redirect :: to ( furl ) ) } , } }
Redirect the user to one page on successful authentication or
another page if authentication fails.
Redirect the user to one page on successful authentication or another page if authentication fails .
&self
ok_redir
&str
err_redir
&str
cookies
&mut Cookies
&self
ok_redir
&str
err_redir
&str
cookies
&mut Cookies