From fcbaaa8a191bfc8ab7c8a1bd3446f31182e15444 Mon Sep 17 00:00:00 2001 From: noha mahmoud Date: Wed, 21 Aug 2019 12:10:00 +0200 Subject: [PATCH] Reset password enabling/disabling added --- config/api-authentication.php | 5 +++++ routes/api.php | 29 ++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/config/api-authentication.php b/config/api-authentication.php index ac6dbff..adf1c88 100644 --- a/config/api-authentication.php +++ b/config/api-authentication.php @@ -11,6 +11,11 @@ */ 'register' => true, + /** + * Determine whether the application support password reset service. + */ + 'password-reset' => true, + /** * The resource transformer for the user model. */ diff --git a/routes/api.php b/routes/api.php index 79bab1c..dc7b703 100644 --- a/routes/api.php +++ b/routes/api.php @@ -14,19 +14,22 @@ config('api-authentication.controllers.register').'@register' )->name('register'); } - // password - Route::post( - config('api-authentication.urls.forget'), - config('api-authentication.controllers.forget').'@sendCode' - )->name('forget-password'); + + // password reset + if (config('api-authentication.password-reset')) { + Route::post( + config('api-authentication.urls.forget'), + config('api-authentication.controllers.forget') . '@sendCode' + )->name('forget-password'); - Route::post( - config('api-authentication.urls.check-code'), - config('api-authentication.controllers.forget').'@verifyCode' - )->name('verifyCode'); + Route::post( + config('api-authentication.urls.check-code'), + config('api-authentication.controllers.forget') . '@verifyCode' + )->name('verifyCode'); - Route::post( - config('api-authentication.urls.reset'), - config('api-authentication.controllers.reset').'@reset' - )->name('reset'); + Route::post( + config('api-authentication.urls.reset'), + config('api-authentication.controllers.reset') . '@reset' + )->name('reset'); + } }); \ No newline at end of file