Auth provider and useGetIdentity() - passing userId if authenticated
Hello,
I've set up my auth provider and with the login method, I'm able to authenticate a user. My backend responds with the user ID. Following the documentation and examples, I can use the getIdentity method in the auth provider to get my userId from localStorage.
After logging in, the user is redirected to the home page, where i need to access its user Id. Again, from the documentation, I can use the hook useGetIdentity to get the authenticated user Id and use it where needed.
It works, and I can get the user id as needed, to use inside my application,
I believe I'm using it as intended, according to the documentation, but is it good practice to set user ids to local storage, regarding security?
Is there any other way to achieve this, using refine?
any guidance is appreciated.
I've set up my auth provider and with the login method, I'm able to authenticate a user. My backend responds with the user ID. Following the documentation and examples, I can use the getIdentity method in the auth provider to get my userId from localStorage.
After logging in, the user is redirected to the home page, where i need to access its user Id. Again, from the documentation, I can use the hook useGetIdentity to get the authenticated user Id and use it where needed.
It works, and I can get the user id as needed, to use inside my application,
I believe I'm using it as intended, according to the documentation, but is it good practice to set user ids to local storage, regarding security?
Is there any other way to achieve this, using refine?
any guidance is appreciated.
