Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume Winter
Hiboo
Commits
cc52be1a
Verified
Commit
cc52be1a
authored
3 years ago
by
ornanovitch
Browse files
Options
Downloads
Patches
Plain Diff
aller jusqu'au bout de la logique...
parent
ff414181
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hiboo/account/settings.py
+6
-6
6 additions, 6 deletions
hiboo/account/settings.py
hiboo/templates/macros.html
+0
-1
0 additions, 1 deletion
hiboo/templates/macros.html
with
6 additions
and
7 deletions
hiboo/account/settings.py
+
6
−
6
View file @
cc52be1a
...
@@ -52,31 +52,31 @@ def totp():
...
@@ -52,31 +52,31 @@ def totp():
@blueprint.route
(
"
/totp/setup
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
@blueprint.route
(
"
/totp/setup
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
@security.authentication_required
()
@security.authentication_required
()
@security.confirmation_required
(
"
S
etup 2FA with TOTP
"
)
@security.confirmation_required
(
"
s
etup 2FA with TOTP
"
)
def
totp_setup
():
def
totp_setup
():
user
=
flask_login
.
current_user
user
=
flask_login
.
current_user
auth
=
models
.
Auth
(
models
.
Auth
.
TOTP
)
auth
=
models
.
Auth
(
models
.
Auth
.
TOTP
)
auth
.
set_otp_key
()
auth
.
set_otp_key
()
user
.
auths
[
models
.
Auth
.
TOTP
]
=
auth
user
.
auths
[
models
.
Auth
.
TOTP
]
=
auth
models
.
log
(
models
.
History
.
MFA
,
comment
=
str
(
_
(
"
2FA has been enabled
"
)),
models
.
log
(
models
.
History
.
MFA
,
comment
=
str
(
_
(
"
2FA
with TOTP
has been enabled
"
)),
user
=
flask_login
.
current_user
)
user
=
flask_login
.
current_user
)
models
.
db
.
session
.
add
(
auth
)
models
.
db
.
session
.
add
(
auth
)
models
.
db
.
session
.
commit
()
models
.
db
.
session
.
commit
()
flask
.
flash
(
_
(
"
Successfully setup 2FA
"
),
"
success
"
)
flask
.
flash
(
_
(
"
Successfully setup 2FA
with TOTP
"
),
"
success
"
)
return
flask
.
redirect
(
flask
.
url_for
(
"
.totp
"
))
return
flask
.
redirect
(
flask
.
url_for
(
"
.totp
"
))
@blueprint.route
(
"
/totp/delete
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
@blueprint.route
(
"
/totp/delete
"
,
methods
=
[
"
GET
"
,
"
POST
"
])
@security.authentication_required
()
@security.authentication_required
()
@security.confirmation_required
(
"
D
elete 2FA with TOTP
"
)
@security.confirmation_required
(
"
d
elete 2FA with TOTP
"
)
def
totp_delete
():
def
totp_delete
():
user
=
flask_login
.
current_user
user
=
flask_login
.
current_user
auth
=
user
.
auths
[
models
.
Auth
.
TOTP
]
auth
=
user
.
auths
[
models
.
Auth
.
TOTP
]
models
.
log
(
models
.
History
.
MFA
,
comment
=
str
(
_
(
"
2FA has been disabled
"
)),
models
.
log
(
models
.
History
.
MFA
,
comment
=
str
(
_
(
"
2FA
with TOTP
has been disabled
"
)),
user
=
flask_login
.
current_user
)
user
=
flask_login
.
current_user
)
models
.
db
.
session
.
delete
(
auth
)
models
.
db
.
session
.
delete
(
auth
)
models
.
db
.
session
.
commit
()
models
.
db
.
session
.
commit
()
flask
.
flash
(
_
(
"
Successfully disabled 2FA
"
),
"
success
"
)
flask
.
flash
(
_
(
"
Successfully disabled 2FA
with TOTP
"
),
"
success
"
)
return
flask
.
redirect
(
flask
.
url_for
(
"
.totp
"
))
return
flask
.
redirect
(
flask
.
url_for
(
"
.totp
"
))
...
...
This diff is collapsed.
Click to expand it.
hiboo/templates/macros.html
+
0
−
1
View file @
cc52be1a
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
"
create
"
:
"
plus
",
"
create
"
:
"
plus
",
"
transition
"
:
"
recycle
",
"
transition
"
:
"
recycle
",
"
password
"
:
"
lock
",
"
password
"
:
"
lock
",
"
enable
2
fa
"
:
"
qrcode
",
"
mfa
"
:
"
qrcode
"
"
mfa
"
:
"
qrcode
"
}[
event.category
]
}}
bg-blue
"
></i>
}[
event.category
]
}}
bg-blue
"
></i>
<div
class=
"timeline-item"
>
<div
class=
"timeline-item"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment