示例#1
0
/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify that the user of the current
| session is logged into this application. The "basic" filter easily
| integrates HTTP Basic authentication for quick, simple checking.
|
*/
Route::filter('auth', function () {
    if (Auth::guest()) {
        $auth = new TiendaNube\Auth(Config::get('tiendanube.client_id'), Config::get('tiendanube.client_secret'));
        // Keep the url according to the language you want
        $url = $auth->login_url_spanish();
        $url = $auth->login_url_brazil();
        return Redirect::to($url);
    }
});
Route::filter('auth.basic', function () {
    return Auth::basic();
});
/*
|--------------------------------------------------------------------------
| Guest Filter
|--------------------------------------------------------------------------
|
| The "guest" filter is the counterpart of the authentication filters as
| it simply checks that the current user is not logged in. A redirect
| response will be issued if they are, which you may freely change.
|