Add role to cookie information
What problem does this address?
In an application, we want to have a secure route but do not want to fetch the user data on each route change
What is your proposed solution?
Add role to the cookie information
What alternatives have you considered?
No response
Additional Context
No response
Hey @martinowren - thanks for this suggestion!
Can you elaborate on what you're looking to achieve / how you would handle this in traditional WordPress?
Our ::set_auth_cookie() function mimics traditional WordPress's wp_set_auth_cookie(), which means we can use the set_auth_cookie action hook to create an additional cookie with whatever information you want.
I know that WordPress expects their cookies to be a specific shape, so I'm not entirely sure how one would go about adding additional information to those without breaking things, but maybe with some more information I could narrow down a solution that also translates to headless.
Hey @martinowren I'm going to close this for now, please feel free to reply with the above, and I'll go ahead and reopen.