Locking yourself out from the admin panel #993
Replies: 2 comments
-
Hey @TimHal — I think this is actually by design and would be fairly convoluted to fix if we wanted to allow the bypassing of relationship fields on the create-first-user operation. I kinda feel like this is up to the dev to fix as the schema, having a required relationship, clearly dictates that users are required to have data in required relationship fields in order to create a user. However, I think there are a few ways that we can avoid having this problem:
What do you think? I'm going to convert this to a discussion for now but I really would love to know your thoughts! |
Beta Was this translation helpful? Give feedback.
-
Hey @jmikrut thanks for the feedback! I agree that it should come down to fixing the schema, that's how I resolved the original issue too. I think seeding the database would be the best way to go and make a nice addition to payload even apart from this issue. This would also resolve another concern where the user might not want to expose the admin dashboard at all on a public server (only using payload for the api) but still needs to define some initial data. I think the best way to do seeding right now is to just have a method for it somewhere after |
Beta Was this translation helpful? Give feedback.
-
Bug Report
It is possible to lock yourself out from the admin panel completely when using an auth-enabled collection as admin users which has a required relationship field.
Expected Behavior
Payload should either
required
relationship when creating the first userCurrent Behavior
Payload greets you with the /create-first-user page. The form requires you to choose an option for the required relationship field. Since no entities of the target collection exist none can be choosen and you are stuck.
Possible Solution
Steps to Reproduce
Examples
collectionUsers
collection toDetailed Description
Payload version: latest (and possibly anything before that)
Browser: any
Beta Was this translation helpful? Give feedback.
All reactions