Security on http requests from AngularJS


I am making http requests to a laravel route, but I need the result of the request not to be shown when accessing the route, for example if I get the users with the route / getUsers the data is displayed as follows

   "email":"[email protected]",
   "created_at":"2018-11-16 10:19:41",
   "updated_at":"2018-11-16 10:19:41"

How could I ensure that the data is not displayed when accessing the route / getUser?

I tried with if(!$request->ajax())return redirect('/'); and when accessing the route redirects me but from the view does not kill anything.

asked by D34d_C0d3 22.11.2018 в 10:25

0 answers