diff --git a/taiga/auth/backends.py b/taiga/auth/backends.py index 8ed19c7f..6ae48ba3 100644 --- a/taiga/auth/backends.py +++ b/taiga/auth/backends.py @@ -37,6 +37,8 @@ fraudulent modifications. import re from django.conf import settings +from django.utils import timezone +from datetime import timedelta from taiga.base.api.authentication import BaseAuthentication from .tokens import get_user_for_token @@ -86,6 +88,10 @@ class Token(BaseAuthentication): user = get_user_for_token(token, "authentication", max_age=max_age_auth_token) + if user.last_login < (timezone.now() - timedelta(minutes=1)): + user.last_login = timezone.now() + user.save(update_fields=["last_login"]) + return (user, token) def authenticate_header(self, request):