Skip to content

Commit

Permalink
Add email verification message to login page for non-verified users
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Sep 7, 2018
1 parent 7b8b3db commit 66244c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2018-09-07 DariusIII
* Chg: Add email verification message to login page for non-verified users
* Fix: Fix displaying errors on registration page
* Fix: Display login errors
* Chg: Update ytake/laravel-smarty to version 2.4.0
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ public function login(Request $request)
$login_type => $request->input('username'),
]);

if ($user->isVerified() === false || $user->isPendingVerification()) {
return $this->showLoginForm('You have not verified your email address!');
}


if (Auth::attempt($request->only($login_type, 'password'), $rememberMe)) {
User::updateSiteAccessed(Auth::id(), (int) Settings::settingValue('..storeuserips') === 1 ? $request->getClientIp() : '');
User::updateSiteAccessed($user->id, (int) Settings::settingValue('..storeuserips') === 1 ? $request->getClientIp() : '');

return redirect()->intended($this->redirectPath());
}
Expand Down

0 comments on commit 66244c6

Please sign in to comment.