diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 18a0d088..d80fb5bf 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Illuminate\Http\Request; class LoginController extends Controller { @@ -37,4 +38,34 @@ class LoginController extends Controller { $this->middleware('guest')->except('logout'); } + + public function login(Request $request) + { + $request->validate([ + $this->username() => 'required|string', + 'password' => 'required|string', + 'g-recaptcha-response' => ['required','recaptcha'], + ]); + + // If the class is using the ThrottlesLogins trait, we can automatically throttle + // the login attempts for this application. We'll key this by the username and + // the IP address of the client making these requests into this application. + if (method_exists($this, 'hasTooManyLoginAttempts') && + $this->hasTooManyLoginAttempts($request)) { + $this->fireLockoutEvent($request); + + return $this->sendLockoutResponse($request); + } + + if ($this->attemptLogin($request)) { + return $this->sendLoginResponse($request); + } + + // If the login attempt was unsuccessful we will increment the number of attempts + // to login and redirect the user back to the login form. Of course, when this + // user surpasses their maximum number of attempts they will get locked out. + $this->incrementLoginAttempts($request); + + return $this->sendFailedLoginResponse($request); + } } diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 952238bd..bdeb024c 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -20,7 +20,8 @@ class ProfileController extends Controller return view('profile.index')->with([ 'user' => Auth::user(), 'credits_reward_after_verify_discord' => Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD'), - 'discord_verify_command' => Configuration::getValueByKey('DISCORD_VERIFY_COMMAND') + 'force_email_verification' => Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION'), + 'force_discord_verification' => Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION'), ]); } diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 2e3f4953..420d1b85 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -54,6 +54,15 @@ @enderror +
Store
- -Store
+ +{{$user->email}}
+{{$user->email}} + @if($user->hasVerifiedEmail()) + + @else + + @endif + +