$user = Auth::user(); is getting null while changing route. #129
-
After installing the application, I can retrieve the authenticated user's information such as their shop domain and email, which is great. However, when I change routes and try to access auth:user, I get a null. It seems that the /authenticate endpoint isn't keeping the user in session. Here is my route list.
Its the AboutController
I want to get the user data there, but its giving me null data in Auth::user , like screenshot |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Yes, that's I tried too. when I am adding the middleware For check the scenario when I am opening the
|
Beta Was this translation helpful? Give feedback.
-
@ryaned2020 As @Kyon147 has correctly pointed out, only the |
Beta Was this translation helpful? Give feedback.
-
@ryaned2020 as @mdrathik you need to make sure you are passing the By using just normal |
Beta Was this translation helpful? Give feedback.
verify.shopify
needs to be on every route, that is why you are losing theAuth::user()
as your about route has no middleware attached to it.