Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we add more convenient way of authorization with custom fields? #453

Open
mkhnuser opened this issue Sep 13, 2021 · 1 comment
Open
Labels

Comments

@mkhnuser
Copy link

I use DRF-simpleJWT for its simplicity and convenience, but there are a lot of moments, when one might want to change default token-obtain fields from username and password to, say, email and password, so you need to write your own CustomObtainTokenSerializer.

Can we solve this "problem" by adding extra functionality in simple-jwt settings?

@Andrew-Chen-Wang
Copy link
Member

It's 5 extra lines of code. The configurations are mostly for stuff that's hard to simply override, and I personally like it that way. Though, your concerns have been raised before (I coined it as "flexibility").

FYI if your model's username field is "email", that's what it'll use. I'll leave this open for discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants