Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Reset password enabling/disabling added
Browse files Browse the repository at this point in the history
  • Loading branch information
NohaMahmoud committed Aug 21, 2019
1 parent a18eaa1 commit fcbaaa8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
5 changes: 5 additions & 0 deletions config/api-authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
*/
'register' => true,

/**
* Determine whether the application support password reset service.
*/
'password-reset' => true,

/**
* The resource transformer for the user model.
*/
Expand Down
29 changes: 16 additions & 13 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});

0 comments on commit fcbaaa8

Please sign in to comment.