Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
be59bff3
Unverified
Commit
be59bff3
authored
Jul 26, 2019
by
BaiJiangJie
Committed by
GitHub
Jul 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3035 from jumpserver/dev
Dev
parents
7e8f7343
28f0302e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
user.py
apps/users/models/user.py
+4
-1
utils.py
apps/users/utils.py
+1
-1
No files found.
apps/users/models/user.py
View file @
be59bff3
...
@@ -55,7 +55,10 @@ class AuthMixin:
...
@@ -55,7 +55,10 @@ class AuthMixin:
return
self
.
is_local
return
self
.
is_local
def
can_update_ssh_key
(
self
):
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
):
def
check_otp
(
self
,
code
):
from
..utils
import
check_otp_code
from
..utils
import
check_otp_code
...
...
apps/users/utils.py
View file @
be59bff3
...
@@ -198,7 +198,7 @@ def check_user_valid(**kwargs):
...
@@ -198,7 +198,7 @@ def check_user_valid(**kwargs):
if
password
and
authenticate
(
username
=
username
,
password
=
password
):
if
password
and
authenticate
(
username
=
username
,
password
=
password
):
return
user
,
''
return
user
,
''
if
public_key
and
user
.
public_key
and
user
.
is_local
:
if
public_key
and
user
.
public_key
and
user
.
can_use_ssh_key_login
()
:
public_key_saved
=
user
.
public_key
.
split
()
public_key_saved
=
user
.
public_key
.
split
()
if
len
(
public_key_saved
)
==
1
:
if
len
(
public_key_saved
)
==
1
:
if
public_key
==
public_key_saved
[
0
]:
if
public_key
==
public_key_saved
[
0
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment