fixing freedcamp bugs and fixed api issues
This commit is contained in:
@@ -34,6 +34,10 @@ class UpdatePasswordController extends Controller
|
||||
if ($validationMessage) {
|
||||
return response()->json(['status' => 400, 'message' => $validationMessage]);
|
||||
}
|
||||
if($request->password == $request->newPassword)
|
||||
{
|
||||
return response()->json(['status' => 400, 'message' => "Your current password and new password could not be same"]);
|
||||
}
|
||||
$user = User::find(auth()->guard('users')->user()->id);
|
||||
if (Hash::check($request->password, $user->password)) {
|
||||
$updatePassword = User::where('id', auth()->guard('users')->user()->id)->update([
|
||||
@@ -43,7 +47,7 @@ class UpdatePasswordController extends Controller
|
||||
\Auth::guard('users')->logout();
|
||||
return response()->json(['status' => 200, 'message' => 'Password Updated Successfully']);
|
||||
}
|
||||
return response()->json(['status' => 400, 'message' => 'Could not update password']);
|
||||
return response()->json(['status' => 400, 'message' => 'Current Password is incorrect']);
|
||||
}
|
||||
|
||||
public function changePinAPI(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user