RealmTeam / django-rest-framework-social-oauth2

python-social-auth and oauth2 support for django-rest-framework
MIT License
1.06k stars 191 forks source link

How to customize the error response ? #114

Closed Dineshs91 closed 7 years ago

Dineshs91 commented 7 years ago

Currently, if wrong credentials are given the response is as follows.

{
  "error": "invalid_grant",
  "error_description": "Invalid credentials given."
}

I want to customize this response to show a different message. Is it possible ?

PhilipGarnero commented 7 years ago

The errors are coming directly from django oauth toolkit. If you want to customize them, you'd have to override my views and reimplement them yourself. Here is something you could start looking at.

Dineshs91 commented 7 years ago

@PhilipGarnero Thanks for the link.