Compare commits
2 Commits
8dd1044d8b
...
7cd5f1c4da
Author | SHA1 | Date |
---|---|---|
b1ek | 7cd5f1c4da | |
b1ek | 41e61d772e |
|
@ -47,4 +47,16 @@ class PublicUserController extends Controller
|
|||
return response()
|
||||
->json('bad_password', 400);
|
||||
}
|
||||
|
||||
public function reset(Request $request)
|
||||
{
|
||||
$user = User::where([ 'email' => $request->input('email') ])->get();
|
||||
if ($user->count() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = $user[0];
|
||||
$user->password = Hash::make($request->input('new_pass'));
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ Route::prefix('/api')->group(function() {
|
|||
Route::controller(PublicUserController::class)->prefix('/users')->group(function() {
|
||||
Route::put('/register', 'register');
|
||||
Route::post('/login', 'login');
|
||||
Route::post('/reset', 'reset');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue