Skip to content

Commit dc42b7a

Browse files
committed
✨ Added frontend and backend validation forgot and reset password
1 parent ab38ad7 commit dc42b7a

File tree

8 files changed

+175
-254
lines changed

8 files changed

+175
-254
lines changed

app/Http/Controllers/API/V1/Auth/ForgotPasswordController.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ protected function sendResetLinkResponse($response)
5151
*/
5252
protected function sendResetLinkFailedResponse(Request $request, $response)
5353
{
54-
return response()->json(['email' => trans($response)], 400);
54+
return response()->json([
55+
'errors' => [
56+
'email' => [
57+
trans($response)],
58+
],
59+
], 400);
5560
}
5661
}

app/Http/Controllers/API/V1/Auth/ResetPasswordController.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\ResetsPasswords;
7+
use Illuminate\Http\Request;
78

89
class ResetPasswordController extends Controller
910
{
@@ -57,6 +58,11 @@ protected function sendResetResponse($response)
5758
*/
5859
protected function sendResetFailedResponse(Request $request, $response)
5960
{
60-
return response()->json(['email' => trans($response)], 400);
61+
return response()->json([
62+
'errors' => [
63+
'email' => [
64+
trans($response)],
65+
],
66+
], 400);
6167
}
6268
}

0 commit comments

Comments
 (0)