From 9806588bc1128238822c70a9e70047fbac5a6a54 Mon Sep 17 00:00:00 2001 From: mahdihty Date: Sat, 10 Apr 2021 16:33:59 +0430 Subject: [PATCH] add resend api --- app/Http/Controllers/AuthController.php | 12 ++++++++++++ routes/api.php | 2 ++ 2 files changed, 14 insertions(+) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 9612844..1e81eae 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -218,6 +218,18 @@ class AuthController extends Controller return response()->json(['message' => 'Register successfully you must be login.'], 200); } + public function resendLink(Request $request) + { + $this->validate($request, [ + 'email' => 'required|email', + 'type' => 'required|string' + ]); + + $this->sendVerification($request->email, $request->type); + + return response()->json(['message' => 'Link resend successfully'], 200); + } + public function createFingerPrint() { $attributes = [ diff --git a/routes/api.php b/routes/api.php index 6986afd..3aa3897 100644 --- a/routes/api.php +++ b/routes/api.php @@ -32,6 +32,8 @@ $router->group(['prefix' => 'auth'], function () use ($router) { $router->post('verification', 'AuthController@verification')->name('verification'); + $router->post('resend', 'AuthController@resendLink'); + $router->get('google/redirect', 'AuthController@redirectToGoogle')->name('google.redirect'); $router->get('google/callback', 'AuthController@handleGoogleCallback')->name('google.callback');