aaronn / django-rest-framework-passwordless

Passwordless Auth for Django REST Framework
MIT License
717 stars 155 forks source link

REST_FRAMEWORK authtoken cannot be changed from default setting #139

Open iambonface opened 9 months ago

iambonface commented 9 months ago

In utils.py, the coded import is from rest_framework.authtoken.models import Token

But in the settings, if the DEFAULT_AUTHENTICATION_CLASSES is overwritten by any other classes other than the REST_FRAMEWORK default TokenAuthentication, then user gets an error when invoking Token.objects.get_or_create(user=user)

Ideally if the framework default is changed, then this should be overwritten to users preferred auth classes.

Example, when as a user I choose to use KNOX, as an Auth Creator, this should overwrite the default Token creator.