-
Is it possible to login as multiple auth-enabled collections simultaneously? Let's say I have Right now, both Auth collections overwrite each other's |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey @sixers! 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 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? |
Beta Was this translation helpful? Give feedback.
-
@jmikrut Hi! Is there any update on this topic? In our application, we have an admins collection which handles the authentication to the /admin panel. Then we have another collection with auth enabled, which is used on the frontend. But if a user logs into the frontend via the mentinoed collection, then afterwards if the user logs into the /admin panel with their admin account, they won't be able to access the protected routes of the frontend, and vice-versa because the cookie will be overridden. |
Beta Was this translation helpful? Give feedback.
Hey @sixers!
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
operation
s access the currently authenticated user fromreq.user
- and while it would be easy enough to change this pattern to usereq.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…