[Update] 是否允许用户更改/使用密钥登录,根据settings配置进行控制

This commit is contained in:
BaiJiangJie
2019-07-26 10:46:43 +08:00
parent 69841a4198
commit 947f16e371
2 changed files with 5 additions and 2 deletions

View File

@@ -55,7 +55,10 @@ class AuthMixin:
return self.is_local
def can_update_ssh_key(self):
return self.is_local
return self.can_use_ssh_key_login()
def can_use_ssh_key_login(self):
return settings.TERMINAL_PUBLIC_KEY_AUTH
def check_otp(self, code):
from ..utils import check_otp_code