Redirecting after successful Login
<p>My <strong>User</strong> wants to <strong>Sign up</strong> for an <strong>Event</strong>. The first layout is for registering for that Event. But my <strong>User</strong> already has an account and chooses an option which automatically leads him to <strong>login</strong> route. After he has been succesfully <strong>authentificated</strong> I want to redirect him to my <strong>payment</strong> form. Normally my succesful authetification would return my Users <strong>profile</strong>. I want to keep that flow <strong>unless</strong> the User is registering for this Event. My project is Laravel <strong>4.2</strong>. Can I use <strong>tokens</strong> or something else? Any options?</p>

<p>This is the <strong>AuthRepository</strong> function:</p>

<pre><code>class AuthRepository implements AuthRepositoryInterface {

    private $messageBag;
    private $errors;

    public function __construct(MessageBag $messageBag) {
        $this-&gt;messageBag = $messageBag;
    }

public function postLogin() {

        $remember_me = (Input::get('remember_me') == 1 ? true : false);

        try
        {
            // Login credentials
            $credentials = array(
                'email'    =&gt; Input::get('email'),
                'password' =&gt; Input::get('password'),
            );

            // Authenticate the user
            $user = \Sentry::authenticate($credentials, $remember_me);

            // Redirect to homepage
            return Redirect::route('profile')-&gt;with('success' , trans('users::success.login_success'));

        }
        catch (\Cartalyst\Sentry\Users\LoginRequiredException $e)
        {
            //echo 'Login field is required.';
            $this-&gt;setErrors('email' , trans('users::users.login_field_is_required'));
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }
        catch (\Cartalyst\Sentry\Users\PasswordRequiredException $e)
        {
            //echo 'Password field is required.';
            $this-&gt;setErrors('password' , trans('users::users.password_field_is_required') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }
        catch (\Cartalyst\Sentry\Users\WrongPasswordException $e)
        {
            //echo 'Wrong password, try again.';
            $this-&gt;setErrors('password' , trans('users::users.wrong_password') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }
        catch (\Cartalyst\Sentry\Users\UserNotFoundException $e)
        {
            //echo 'User was not found.';
            $this-&gt;setErrors('email' , trans('users::users.user_was_not_found') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }
        catch (\Cartalyst\Sentry\Users\UserNotActivatedException $e)
        {
            //echo 'User is not activated.';
            $this-&gt;setErrors('email' , trans('users::users.user_is_not_activated') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }

        // The following is only required if the throttling is enabled
        catch (\Cartalyst\Sentry\Throttling\UserSuspendedException $e)
        {
            //echo 'User is suspended.';
            $this-&gt;setErrors('email' , trans('users::users.user_is_suspended') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }
        catch (\Cartalyst\Sentry\Throttling\UserBannedException $e)
        {
            //echo 'User is banned.';
            $this-&gt;setErrors('email' , trans('users::users.user_is_banned') );
            return Redirect::back()-&gt;withInput()-&gt;withErrors($this-&gt;getErrors());
        }

    }


}
</code></pre>

<p>My <strong>AuthController</strong>:</p>

<p>

<pre><code>namespace \Users\Controllers;

use \Users\Repositories\AuthRepository;


class AuthController extends \BaseController {

    protected $auth;


    public function __construct(AuthRepository $auth) {
        $this-&gt;auth = $auth;
    }

    public function login() {
        return $this-&gt;auth-&gt;login();
    }

    public function postLogin() {
        return $this-&gt;auth-&gt;postLogin();
    }

    public function logout() {
        return $this-&gt;auth-&gt;logout();
    }
} 
</code></pre>

<p>My <strong>routes</strong>:</p>

<pre><code>Route::get( '/login' ,                              array( 'as' =&gt; 'login' , 'uses' =&gt; 'HomeController@userLogin' ) );
Route::post('/login' ,                              array( 'as' =&gt; 'postLogin' , 'uses' =&gt; '\Users\Controllers\AuthController@postLogin' ) );
</code></pre>

<p>And finnaly the one I want to be <strong>redirected</strong> to:</p>

<pre><code>Route::get('/fee/{id}/register/'  ,                 array( 'as' =&gt; 'frontend.fee.registration' ,    'uses' =&gt; 'FeeController@feeRegistration' ) );
</code></pre>