add last login

This commit is contained in:
2025-12-03 01:55:45 -03:00
parent a54f76f87a
commit 47f3086776

View File

@@ -44,6 +44,14 @@ def authentication(
if not pbkdf2_sha256.verify(password, password_hash): if not pbkdf2_sha256.verify(password, password_hash):
raise InvalidCredentialsError('Invalid credentials') raise InvalidCredentialsError('Invalid credentials')
dyn.update_item(
key=KeyPair(user_id, '0'),
# Post-migration (users): uncomment the following line
# update_expr='SET last_login = :now',
update_expr='SET lastLogin = :now',
expr_attr_values={':now': now()},
)
return Response( return Response(
status_code=HTTPStatus.OK, status_code=HTTPStatus.OK,
cookies=[ cookies=[