Is it possible to login as multiple auth-enabled collections simultaneously?
Let's say I have
Users collection and
Admins collection, and I want to be be logged in as both
User (in the frontend part) and
Admin (in the admin panel) at the same time. Is it doable?
Right now, both Auth collections overwrite each other's
payload-token cookie. Would it be enough to simply use different cookie names? Is it configurable?
Unfortunately there are many complexities below the surface of doing something like this.
For example, if you were logged in as 2 different users, how would Payload know which user you were intending to be using for any given request? Payload
operations access the currently authenticated user from
req.user - and while it would be easy enough to change this pattern to use
req.users or similar instead, we would still need to know which user to rely on.
Making auth cookie names dynamic would certainly be one piece of the puzzle, but there are many more complex issues and use cases that would need to be thought through fully here.
We can keep it on the radar for sure though. What do you think?
Thanks! Ok, that makes sense. In that case, I'll combine the two collections. I wanted to keep them separate, because they have completely different fields, but it's not a big deal.