Comments (6)
In my opinion, ObtainJSONWebToken
is a login process, the user sends his credentials and authenticates.
Perhaps it would be advisable to update it using the "Customizing" option and that each developer decides.
from django-graphql-jwt.
Thanks @tguillemot, that's a good question.
The reason to include the login is to send the user_logged_in
signal and update the last_login
user field.
I totally agree with you, ObtainJSONWebToken
should not save the user session, login()
must disappear and may be replaced by the signal.
from django.contrib.auth.signals import user_logged_in
user_logged_in.send(sender=user.__class__, request=info.context, user=user)
What do you think about sending this signal?
from django-graphql-jwt.
I had a look on how Django Rest Framework JWT solves that.
It seems that they prefer not updating last_login
as explained on that issue.
As they said, by generating a JWT you fetch the user but do not update it.
I agree with that.
Do you have a case where last_login
is useful for JWT ?
from django-graphql-jwt.
In my opinion, ObtainJSONWebToken is a login process, the user sends his credentials and authenticates.
We can see things like that indeed.
Perhaps it would be advisable to update it using the "Customizing" option and that each developer decides.
I do not have a strong feeling on that.
For me, it is not big deal if last_login
is updated or not.
So, you can update last_login
by default (or not) and if someone has a big problem with that one day he will open an issue anyway 😄.
Thanks for your answers and discussions !!!
from django-graphql-jwt.
Thanks, it was a pleasure talking to you :)
from django-graphql-jwt.
@mongkok last_login field is used as salt for generation tokens for links when email changes and password resets
from django-graphql-jwt.
Related Issues (20)
- modulenotfounderror: no module named 'graphql_jwt'
- How to delete a Token from the server-side (mutation). when a user gives a logout the token will be destroyed from server-side by using mutation? is it possible? If so. please explain. HOT 2
- How can I create/set JWT Token in Django view and then redirect to Frontend? HOT 1
- fails if root object types not named Query and Mutation HOT 3
- Cant Delete Cookies With Same Settings with tokenAuth Mutation
- Implement a log out HOT 1
- TypeError: Signal.__init__() got an unexpected keyword argument 'providing_args' HOT 1
- Selective application of JWT expiration check for specific operations
- import error from strawberry_django.utlis
- Tests fails in year 2038
- Graphene 3 support? HOT 2
- TypeError: JSONWebTokenMiddleware.__init__() takes 1 positional argument but 2 were given
- from django.utils.translation import ugettext as _
- Add custom key-value pair in JWT payload.
- cannot import name 'ugettext' from 'django.utils.translation' HOT 4
- Add fingerprint to token and cookies to prevent sidejacking
- Case sensitive Username
- TypeError: Signal.__init__() got an unexpected keyword argument 'providing_args' HOT 1
- JWT Stateless User Authentication
- Breaks when users are deleted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-graphql-jwt.