mirror of https://github.com/jumpserver/jumpserver
parent
c6949b4f68
commit
81ef614820
|
@ -1,5 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
|
import time
|
||||||
|
|
||||||
from django.db.models.signals import (
|
from django.db.models.signals import (
|
||||||
post_save, m2m_changed, pre_delete
|
post_save, m2m_changed, pre_delete
|
||||||
)
|
)
|
||||||
|
@ -275,6 +277,7 @@ def on_user_auth_success(sender, user, request, login_type=None, **kwargs):
|
||||||
check_different_city_login_if_need(user, request)
|
check_different_city_login_if_need(user, request)
|
||||||
data = generate_data(user.username, request, login_type=login_type)
|
data = generate_data(user.username, request, login_type=login_type)
|
||||||
request.session['login_time'] = data['datetime'].strftime("%Y-%m-%d %H:%M:%S")
|
request.session['login_time'] = data['datetime'].strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
request.session["MFA_VERIFY_TIME"] = int(time.time())
|
||||||
data.update({'mfa': int(user.mfa_enabled), 'status': True})
|
data.update({'mfa': int(user.mfa_enabled), 'status': True})
|
||||||
write_login_log(**data)
|
write_login_log(**data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue