iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.64k stars 306 forks source link

Fix crash on bad auth code #469

Closed c-w closed 1 year ago

c-w commented 1 year ago

When using the code authentication flow, a bad value currently crashes the library which leads to a HTTP 500 response bubbling up. This is inconsistent with the access token authentication flow which instead return a HTTP 400 response for a bad value.

This pull request fixes the inconsistency by returning a HTTP 400 response when the authentication code is rejected by the social provider.