New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ajax call Sentinel::check() and Sentinel::getUser() always return null #354
Comments
What Laravel version are you using? |
laravel 5.3 |
Is that route you posted using the |
I did not use a middleware This is my code in api.php user(); })->middleware('auth:api'); Route::post('/showMarkers', 'MapLocationsController@showMarkers'); Route::post('/managersShowMarkers', 'ManagerController@managersShowMarkers'); |
You'll need to use the |
Thanks for reply, but it's not working with |
Is it working as expected without being an Ajax request? |
Yes, it's working correctly |
So something on those routes are not correctly setup. Therefore i believe it's not a Sentinel issue since it's working as expected in the rest of your application. |
@hbsoftco Do you able to solve this problem ? I am facing same problem. |
@joginder89 I used another way. |
Hi
I'm using Sentinel package, Everything is fine, But when I want call Sentinel::check() and Sentinel::getUser() using ajax, it return null. help me please :(
my route in api.php
Route::post('/managersShowMarkers', 'ManagerController@managersShowMarkers');
managerShowMarkers method in ManagerController
public function managersShowMarkers() { $currentUser = Sentinel::getUser(); $my_id = $currentUser->id; $markers = MapLocation::where('code_shahrestan', $my_id)->get(); return $markers; }
jquery and ajax
`var map;
var marker;
jQuery(document).ready(function () {
The text was updated successfully, but these errors were encountered: