Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'except' pages #510

Open
hugofabricio opened this issue Feb 3, 2015 · 0 comments
Open

'except' pages #510

hugofabricio opened this issue Feb 3, 2015 · 0 comments
Labels

Comments

@hugofabricio
Copy link

Good morning,

*I'm using the trust running confide, but after entering Route :: when ('admin ', 'auth.admin'); the access is created excess redirects, has anyone had this problem?

Below is my code.


Bom dia,

Estou utilizando o confide funcionando perfeitamente, mas após inserir Route::when('admin*', 'auth.admin'); ao acessar é criado redirecionamentos em excesso, alguém já teve este problema?

Segue abaixo meus códigos.


Filter

Route::filter('auth.admin', function () {
    if (Auth::guest()) {
        return Redirect::action('AdminUsersController@login');
    }
});

Route::when('admin*', 'auth.admin');

Controller

public function __construct()
{
    $this->beforeFilter('auth.admin', ['except' => ['login','doLogin']]);
}

/*
* Login
*/
public function login()
{

    if (Confide::user()):
        return Redirect::action('AdminHomeController@index');
    else:
        return View::make('Admin::users.login')
                    ->with('title', 'Acessar');
    endif;

}

Routes

Route::group(
    [
        'prefix' => 'admin'
    ],
    function () {

        # Acessar
        Route::get(
            'acessar',
            [
                'uses' => 'AdminUsersController@login'
            ]
        );

        Route::post(
            'acessar',
            [
                'uses' => 'AdminUsersController@doLogin'
            ]
        );

        # Sair
        Route::get(
            'sair',
            [
                'uses' => 'AdminUsersController@logout'
            ]
        );

        # Confirmar Conta
        Route::get(
            'confirmar-conta/{code}',
            [
                'uses' => 'AdminUsersController@confirm'
            ]
        );

        # Recuperar Password
        Route::get(
            'esqueci-minha-senha',
            [
                'uses' => 'AdminUsersController@forgotPassword'
            ]
        );

        Route::post(
            'esqueci-minha-senha',
            [
                'uses' => 'AdminUsersController@doForgotPassword',
            ]
        );

        # Resetar Senha
        Route::get(
            'resetar-minha-senha',
            [
                'uses' => 'AdminUsersController@resetPassword'
            ]
        );

        Route::post(
            'resetar-minha-senha',
            [
                'uses' => 'AdminUsersController@doResetPassword'
            ]
        );

        # Before auth
        Route::group(
            [
                'before' => 'auth.admin'
            ],
            function () {

                # Home
                Route::get(
                    '/',
                    [
                        'uses' => 'AdminHomeController@index'
                    ]
                );

                // Route::get('users/create', 'UsersController@create');
                // Route::post('users', 'UsersController@store');

            }
        );

    }
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants