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
8447c6f4
Commit
8447c6f4
authored
Apr 20, 2018
by
BaiJiangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改coco文案OTP改为MFA
parent
ad6e22cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
api.py
apps/users/api.py
+2
-2
No files found.
apps/users/api.py
View file @
8447c6f4
...
@@ -153,7 +153,7 @@ class UserOtpAuthApi(APIView):
...
@@ -153,7 +153,7 @@ class UserOtpAuthApi(APIView):
return
Response
({
'msg'
:
'请先进行用户名和密码验证'
},
status
=
401
)
return
Response
({
'msg'
:
'请先进行用户名和密码验证'
},
status
=
401
)
if
not
check_otp_code
(
user
.
otp_secret_key
,
otp_code
):
if
not
check_otp_code
(
user
.
otp_secret_key
,
otp_code
):
return
Response
({
'msg'
:
'
otp
认证失败'
},
status
=
401
)
return
Response
({
'msg'
:
'
MFA
认证失败'
},
status
=
401
)
token
=
generate_token
(
request
,
user
)
token
=
generate_token
(
request
,
user
)
self
.
write_login_log
(
request
,
user
)
self
.
write_login_log
(
request
,
user
)
...
@@ -204,7 +204,7 @@ class UserAuthApi(APIView):
...
@@ -204,7 +204,7 @@ class UserAuthApi(APIView):
return
Response
(
return
Response
(
{
{
'code'
:
101
,
'code'
:
101
,
'msg'
:
'请携带seed值,进行
OTP
二次认证'
,
'msg'
:
'请携带seed值,进行
MFA
二次认证'
,
'otp_url'
:
reverse
(
'api-users:user-otp-auth'
),
'otp_url'
:
reverse
(
'api-users:user-otp-auth'
),
'seed'
:
seed
,
'seed'
:
seed
,
'user'
:
self
.
serializer_class
(
user
)
.
data
'user'
:
self
.
serializer_class
(
user
)
.
data
...
...
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