Skip to content
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

Authentication data persists on refresh until i pass permissions for role-based access in userState then it signs me out on refresh #1761

Open
Hamza-Bin-Shoaib opened this issue Jun 11, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Hamza-Bin-Shoaib
Copy link

Prerequisites:

Please answer the following questions for yourself before asking questions.

  • [ ✓] This is question only ❓
  • [✓ ] I am running the latest version
  • [✓ ] I checked the documentation and found no answer
  • [✓ ] I checked to make sure that this is not already asked
  • [✓ ] I'm asking the question in the correct repository

Describe the question
In my login component, I am storing data in userState, my login is working perfectly fine, it persists on refresh but when I pass
permissions: response.data.permissions in userState, it starts signing me out on page refresh and if I remove permissions it works fine again.

Screenshots
Capture

Please provide the following information:

  • OS: [Windows 10]
  • Browser [Chrome]
  • Version [e.g. 22]

License

MIT © React Auth Kit

@Hamza-Bin-Shoaib Hamza-Bin-Shoaib added the question Further information is requested label Jun 11, 2024
@Hamza-Bin-Shoaib
Copy link
Author

I solved this issue by storing permissions in a redux state and making them persist using redux-persist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant