public function doLogin()
    {
        $remember = Input::post('remember', false);
        $email    = Input::post('email');
        $redirect = Input::post('redirect');
        $redirect = ($redirect) ? $redirect : 'admin';

        try{
            $credential = array(
                'email'     => $email,
                'password'  => Input::post('password')
            );

            // Try to authenticate the user
            $user = Sentry::authenticate($credential, false);

            if($remember){
                Sentry::loginAndRemember($user);
            }else{
                Sentry::login($user, false);
            }

            Response::redirect($this->siteUrl($redirect));
        }catch(\Exception $e){
            App::flash('message', $e->getMessage());
            App::flash('email', $email);
            App::flash('redirect', $redirect);
            App::flash('remember', $remember);

            Response::redirect($this->siteUrl('login'));
        }
    }
public function doLogin()
    {
        $remember = Input::post('remember', false);
        $email    = Input::post('email');
        $redirect = Input::post('redirect');
        $redirect = ($redirect) ? $redirect : 'admin';

        try{
            $credential = array(
                'email'     => $email,
                'password'  => Input::post('password')
            );

            // Try to authenticate the user
            $user = Sentry::authenticate($credential, false);

            if($remember){
                Sentry::loginAndRemember($user);
            }else{
                Sentry::login($user, false);
            }

            Response::redirect($this->siteUrl($redirect));
        }catch(\Exception $e){
            App::flash('message', $e->getMessage());
            App::flash('email', $email);
            App::flash('redirect', $redirect);
            App::flash('remember', $remember);

            Response::redirect($this->siteUrl('login'));
        }
    }
public function doLogin ( ) { $ remember = Input :: post ( 'remember' , false ) ; $ email = Input :: post ( 'email' ) ; $ redirect = Input :: post ( 'redirect' ) ; $ redirect = ( $ redirect ) ? $ redirect : 'admin' ; try { $ credential = array ( 'email' => $ email , 'password' => Input :: post ( 'password' ) ) ; // Try to authenticate the user $ user = Sentry :: authenticate ( $ credential , false ) ; if ( $ remember ) { Sentry :: loginAndRemember ( $ user ) ; } else { Sentry :: login ( $ user , false ) ; } Response :: redirect ( $ this -> siteUrl ( $ redirect ) ) ; } catch ( \ Exception $ e ) { App :: flash ( 'message' , $ e -> getMessage ( ) ) ; App :: flash ( 'email' , $ email ) ; App :: flash ( 'redirect' , $ redirect ) ; App :: flash ( 'remember' , $ remember ) ; Response :: redirect ( $ this -> siteUrl ( 'login' ) ) ; } }
Process the login
Process the login