Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::group(array('before' => 'auth'), function(){
- Route::controller(Controller::detect());
- });
- Route::get('login', function(){
- return View::make('dashboard.login');
- });
- Route::post('login', function(){
- $userinfo = array(
- 'username' => Input::get('login'),
- 'password' => Input::get('senha')
- );
- if(Auth::attempt($userinfo))
- return Redirect::to('/');
- else
- return Redirect::to('login')
- ->with('login_errors', true);
- });
- Route::get('logout', function(){
- Auth::logout();
- return Redirect::to('/');
- });
- Route::filter('auth', function()
- {
- if (Auth::guest()) {
- return Redirect::to('login');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement