Cachet/app/controllers/AuthController.php
2014-11-24 17:21:50 +00:00

25 lines
527 B
PHP

<?php
/**
* Logs users into their account
*/
class AuthController extends Controller {
public function showLogin() {
return View::make('auth.login');
}
public function postLogin() {
if (Auth::attempt(Input::only(['email', 'password']))) {
return Redirect::intended('dashboard');
} else {
return Redirect::back()->withInput(Input::except('password'))->with('error', 'Invalid email or password');
}
}
public function logoutAction() {
Auth::logout();
return Redirect::to('/');
}
}