From 7f14c6ddf81ce73c4695f57148a887954917f808 Mon Sep 17 00:00:00 2001 From: mahdihty Date: Sat, 10 Apr 2021 16:42:50 +0430 Subject: [PATCH] some change in resend method --- app/Http/Controllers/AuthController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 1e81eae..9b49212 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -225,9 +225,15 @@ class AuthController extends Controller 'type' => 'required|string' ]); - $this->sendVerification($request->email, $request->type); + $user_db = User::where('email', $request->email)->first(); + $user_cache = Cache::get($request->email); - return response()->json(['message' => 'Link resend successfully'], 200); + if ($user_db || $user_cache) { + $this->sendVerification($request->email, $request->type); + return response()->json(['message' => 'Link resend successfully'], 200); + } + + abort(403); } public function createFingerPrint()