Hi,
Is there any reason for the last_login field, in the auth_user table, is not updated
I'm not sure why that would be. We just use the standard authentication API for Django. I would dig into how that API updates the last_login field and see how that's being done.
Yes, I noticed this behaviour quite a while ago, but solved it by editing the serializers.py file, adding this two lines at the end of the validate() function:
#update last_login after getting token
self.user.last_login = timezone.now()
self.user.save()
return {}
Don't know if this is the best/only way to do it though, @davesque .
@andreafonso,
there are different ways to solve the problem, I imagine that it is important a solution that does not create hardcode.
@davesque,
I am using the latest version of Django. without any change in the default behavior.
If it is a defect I can, I can search for a solution and send a "pull request"
@m2mbr I'd say first try and find the ways in which the default django.contrib.auth authentication framework updates this value. Then figure out why that code doesn't get triggered by simple jwt.
Ok I'll do this.
Same problem
Added in #238
Most helpful comment
Fix https://github.com/davesque/django-rest-framework-simplejwt/pull/136