I’m working on a mobile app project that has got a login page. The login works successfully, but as soon as I try to get any details about the user in a separate Server Action using the identity that’s returned by the Security Provider, the identity is returned as ‘null’ so the query fails.
If I add the query to the same Server Action file as the login step, the Security Provider returns the correct identity and it works, but this isn’t very useful for keeping the rest of the app secure. It seems like the Security Provider is forgetting the identity as soon as the Server Action has completed, even though there are cookies being set.
I’ve followed the ‘Security and Login’ tutorials to set up the Server Actions, and the Security Providers are linked to the same Action File, so it should be working.
Does anybody know why this might be happening?
Thanks.