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 +
+ {!! htmlFormSnippet() !!} + @error('g-recaptcha-response') + + {{ $message }} + + @enderror +
+
diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 094cbb2b..4992d291 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -96,7 +96,8 @@ Log back in @endif - + Redeem code @@ -150,13 +151,15 @@ - + @if(env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID') || env('APP_ENV', 'local') == 'local') + + @endif @if(Auth::user()->role == 'admin') @@ -290,7 +293,7 @@
@if(!Auth::user()->hasVerifiedEmail()) - @if(Auth::user()->created_at->diffInHours(now(), false) > 2) + @if(Auth::user()->created_at->diffInHours(now(), false) > 1)
Warning!
You have not yet verified your email address
-
+
+ @if(!Auth::user()->hasVerifiedEmail() && strtolower($force_email_verification) == 'true') + + @endif + + @if(is_null(Auth::user()->discordUser) && strtolower($force_discord_verification) == 'true') + @if(!empty(env('DISCORD_CLIENT_ID')) && !empty(env('DISCORD_CLIENT_SECRET'))) +
+
Required Discord verification!
+ You have not yet verified your discord account + Login with discord
+ Please contact support If you face any issues. +
+ @else +
+
Required Discord verification!
+ Due to system settings you are required to verify your discord account!
+ It looks like this hasn't been set-up correctly! Please contact support. +
+ @endif + @endif
@@ -50,7 +76,14 @@

{{$user->name}}

-

{{$user->email}}

+

{{$user->email}} + @if($user->hasVerifiedEmail()) + + @else + + @endif + +

{{$user->Credits()}}
diff --git a/resources/views/store/index.blade.php b/resources/views/store/index.blade.php index 8f448c2b..c022054e 100644 --- a/resources/views/store/index.blade.php +++ b/resources/views/store/index.blade.php @@ -24,6 +24,12 @@
+
+ +
+ @if($isPaypalSetup && $products->count() > 0)