mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 00:11:07 +03:30
fix: verify password
This commit is contained in:
@@ -22,7 +22,7 @@ trait SendsPasswordResetEmails
|
|||||||
public function sendDisposablePassword(Request $request)
|
public function sendDisposablePassword(Request $request)
|
||||||
{
|
{
|
||||||
$this->validatePhone($request);
|
$this->validatePhone($request);
|
||||||
|
|
||||||
// We will send the Disposable Password
|
// We will send the Disposable Password
|
||||||
// to send the Disposable Password , we will examine the response then see the message we
|
// to send the Disposable Password , we will examine the response then see the message we
|
||||||
// need to show to the user. Finally, we'll send out a proper response.
|
// need to show to the user. Finally, we'll send out a proper response.
|
||||||
@@ -38,15 +38,14 @@ trait SendsPasswordResetEmails
|
|||||||
*/
|
*/
|
||||||
public function checkDisposablePassword(Request $request)
|
public function checkDisposablePassword(Request $request)
|
||||||
{
|
{
|
||||||
if ( \Cache::has($request->code) ) {
|
$userid = \Cache::pull($request->code);
|
||||||
$userid = \Cache::pull($request->code);
|
if ( !is_null($userid) ) {
|
||||||
$user = User::findOrFail($userid);
|
$user = User::findOrFail($userid);
|
||||||
if($user) {
|
if($user) {
|
||||||
|
|
||||||
$user->password = \Hash::make($request->code);
|
$user->password = \Hash::make($request->code);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$request->merge([ 'cell_number' => $user->cell_number ]);
|
$request->merge([ 'cell_number' => $user->cell_number, 'password' => $request->code ]);
|
||||||
return (new LoginController())->login($request);
|
return (new LoginController())->login($request);
|
||||||
}
|
}
|
||||||
return MessageResponse::error('User Not Found');
|
return MessageResponse::error('User Not Found');
|
||||||
|
|||||||
Reference in New Issue
Block a user