Unable to create "Single User" level API key, always defaults to "All Users"

I can reproduce the issue if I follow the steps you have listed. When creating an API key for a single user, Discourse expects a username to be added to the form’s User field:

If ‘Single User’ is selected as the User Level, but no username is added to the User field, an All Users API key is created. I would expect an error message to be displayed instead. Similar to what happens when the form is submitted without a description.

3 Likes