curveball / a12n-server

An open source lightweight OAuth2 server
Apache License 2.0
448 stars 49 forks source link

Don't throw 500 on conflicts when creating a new oauth2 client #399

Closed evert closed 2 years ago

evert commented 2 years ago

If you're creating a new OAuth2 client, and you're using a client_id that's already in the system, a12nserver will emit a 500 error due to a violation of the unique constraint.

It would be nice if instead we threw a more user-friendly error. This should probably be a 409 conflict.

To create a new OAuth2 client:

  1. Go to 'Apps'
  2. Create new App.
  3. Find the new App resource you created, there should be an option to see the 'oauth2 clients'.
  4. From there, there should be a navigation item to create a new client.