Hirevo / alexandrie

An alternative crate registry, implemented in Rust.
https://hirevo.github.io/alexandrie/
Apache License 2.0
493 stars 55 forks source link

Github OAuth breaks on second OAuth attempt, after first prompt was denied by user. #187

Open nlflint opened 5 months ago

nlflint commented 5 months ago

Repo steps:

  1. Setup Alexandrie with Github integration and allow registration
  2. Open a private browsing session (or logout of github and alexandrie).
  3. Go to your alexandrie page
  4. Click "Login with github" button.
  5. Login to github with a user that is not yet linked to alexandrie
  6. Observe Github OAuth prompt
  7. Deny the prompt
  8. Go back to Alexandrie page
  9. Click login with github again
  10. Accept the OAuth prompt this time

Expected Result: Redirected to callback and logged into main page successfully.

Actual Result: Callback to Alexandrie fails with HTTP 500.

Workaround: I entered the sqlite database and saw the user was added to a 3 tables. I deleted all rows for that half-initialized user, tried again (without denying OAuth this time), and user was added without a problem. Maybe it's using the old auth token initially added to the database instead of the new one?