django-rest-framework-passwordless icon indicating copy to clipboard operation
django-rest-framework-passwordless copied to clipboard

REST_FRAMEWORK authtoken cannot be changed from default setting

Open iambonface opened this issue 1 year ago • 0 comments

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.

iambonface avatar Jan 28 '24 22:01 iambonface