mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-04-04 03:12:38 +00:00
* perf: 优化mfa 和登录 * perf: stash * stash * pref: 基本完成 * perf: remove init function * perf: 优化命名 * perf: 优化backends * perf: 基本完成优化 * perf: 修复首页登录时没有 toastr 的问题 Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Jiangjie.Bai <32935519+BaiJiangJie@users.noreply.github.com>
25 lines
677 B
Python
25 lines
677 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
from __future__ import unicode_literals
|
|
from django.views.generic.base import TemplateView
|
|
|
|
from common.permissions import IsValidUser
|
|
from common.mixins.views import PermissionsMixin
|
|
from users.models import User
|
|
|
|
__all__ = ['MFASettingView']
|
|
|
|
|
|
class MFASettingView(PermissionsMixin, TemplateView):
|
|
template_name = 'users/mfa_setting.html'
|
|
permission_classes = [IsValidUser]
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
mfa_backends = User.get_user_mfa_backends(self.request.user)
|
|
context.update({
|
|
'mfa_backends': mfa_backends,
|
|
})
|
|
return context
|
|
|