Cachet/app/controllers/AuthController.php

27 lines
636 B
PHP
Raw Normal View History

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