public function postLogin() {
try {
if ( ! Auth::attempt( Input::only('email', 'password') ) ) {
throw new UserNotFoundException();
}
if ( Auth::once( Input::only('email', 'password') ) ) {
if ( ! Auth::user()->active ) {
Auth::logout();
throw new UserNotActivatedException();
}
}
// return
}
catch (UserNotFoundException $e) {
Session::flash('error', 'Invalid email or password.');
// return
}
catch (UserNotActivatedException $e) {
Session::flash('error', 'Account not activated.');
// return
}
}
do you mind explaining a bit how this works and to what function do I add the the boolean for the remember token !!
The first bit checks if the user used the right credentials. If the user did not give the right credentials it throws an error.
The second part checks if the user is activated.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community