Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
Add data to the auth api
Browse files Browse the repository at this point in the history
  • Loading branch information
WillianDamasceno committed Jun 1, 2024
1 parent 4341677 commit d7d1d69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'password' => bcrypt($request->password),
]);

return response()->json($user->id);
return response()->json(['data' => $user->id]);
});

Route::get('/login', function (Request $request) {
Expand All @@ -49,7 +49,7 @@
return response()->json(['message' => 'Invalid password'], 401);
}

return response()->json($user->id);
return response()->json(['data' => $user->id]);
});

Route::get('/update', function () {
Expand Down Expand Up @@ -83,11 +83,11 @@

$user->save();

return response()->json($user->id);
return response()->json(['data' => $user->id]);
});

Route::get('/delete', function () {
return response()->json(User::where('id', 1)->delete());
return response()->json(['data' => User::where('id', 1)->delete()]);
});
});

Expand Down

0 comments on commit d7d1d69

Please sign in to comment.