Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
603eaac4
Commit
603eaac4
authored
2 years ago
by
sandeepsajan0
Committed by
Fredrik Jonsson
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update Backuptoken passwordform view and add custom setup view
parent
e0be1fe4
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
hypha/apply/users/urls.py
+2
-0
2 additions, 0 deletions
hypha/apply/users/urls.py
hypha/apply/users/views.py
+7
-1
7 additions, 1 deletion
hypha/apply/users/views.py
with
9 additions
and
1 deletion
hypha/apply/users/urls.py
+
2
−
0
View file @
603eaac4
...
@@ -13,6 +13,7 @@ from .views import (
...
@@ -13,6 +13,7 @@ from .views import (
TWOFABackupTokensPasswordView
,
TWOFABackupTokensPasswordView
,
TWOFADisableView
,
TWOFADisableView
,
TWOFARequiredMessageView
,
TWOFARequiredMessageView
,
TWOFASetupView
,
become
,
become
,
create_password
,
create_password
,
oauth
,
oauth
,
...
@@ -87,6 +88,7 @@ urlpatterns = [
...
@@ -87,6 +88,7 @@ urlpatterns = [
),
),
# Two factor redirect
# Two factor redirect
path
(
'
two_factor/required/
'
,
TWOFARequiredMessageView
.
as_view
(),
name
=
'
two_factor_required
'
),
path
(
'
two_factor/required/
'
,
TWOFARequiredMessageView
.
as_view
(),
name
=
'
two_factor_required
'
),
path
(
'
two_factor/setup/
'
,
TWOFASetupView
.
as_view
(),
name
=
"
two_factor_setup
"
),
path
(
'
two_factor/backup_tokens/password/
'
,
TWOFABackupTokensPasswordView
.
as_view
(),
name
=
'
backup_tokens_password
'
),
path
(
'
two_factor/backup_tokens/password/
'
,
TWOFABackupTokensPasswordView
.
as_view
(),
name
=
'
backup_tokens_password
'
),
path
(
'
two_factor/disable/
'
,
TWOFADisableView
.
as_view
(),
name
=
'
disable
'
),
path
(
'
two_factor/disable/
'
,
TWOFADisableView
.
as_view
(),
name
=
'
disable
'
),
path
(
'
two_factor/admin/disable/<str:user_id>/
'
,
TWOFAAdminDisableView
.
as_view
(),
name
=
'
admin_disable
'
),
path
(
'
two_factor/admin/disable/<str:user_id>/
'
,
TWOFAAdminDisableView
.
as_view
(),
name
=
'
admin_disable
'
),
...
...
This diff is collapsed.
Click to expand it.
hypha/apply/users/views.py
+
7
−
1
View file @
603eaac4
...
@@ -24,6 +24,8 @@ from hijack.views import AcquireUserView
...
@@ -24,6 +24,8 @@ from hijack.views import AcquireUserView
from
two_factor.forms
import
AuthenticationTokenForm
,
BackupTokenForm
from
two_factor.forms
import
AuthenticationTokenForm
,
BackupTokenForm
from
two_factor.views
import
DisableView
as
TwoFactorDisableView
from
two_factor.views
import
DisableView
as
TwoFactorDisableView
from
two_factor.views
import
LoginView
as
TwoFactorLoginView
from
two_factor.views
import
LoginView
as
TwoFactorLoginView
from
two_factor.views
import
SetupView
as
TwoFactorSetupView
from
two_factor.views
import
BackupTokensView
as
TwoFactorBackupTokensView
from
two_factor.utils
import
default_device
from
two_factor.utils
import
default_device
from
wagtail.admin.views.account
import
password_management_enabled
from
wagtail.admin.views.account
import
password_management_enabled
from
wagtail.core.models
import
Site
from
wagtail.core.models
import
Site
...
@@ -284,7 +286,7 @@ def create_password(request):
...
@@ -284,7 +286,7 @@ def create_password(request):
@method_decorator
(
login_required
,
name
=
'
dispatch
'
)
@method_decorator
(
login_required
,
name
=
'
dispatch
'
)
class
TWOFABackupTokensPasswordView
(
Form
View
):
class
TWOFABackupTokensPasswordView
(
TwoFactorBackupTokens
View
):
"""
"""
Require password to see backup codes
Require password to see backup codes
"""
"""
...
@@ -349,5 +351,9 @@ class TWOFAAdminDisableView(FormView):
...
@@ -349,5 +351,9 @@ class TWOFAAdminDisableView(FormView):
return
ctx
return
ctx
class
TWOFASetupView
(
TwoFactorSetupView
):
success_url
=
"
users:backup_tokens_password
"
class
TWOFARequiredMessageView
(
TemplateView
):
class
TWOFARequiredMessageView
(
TemplateView
):
template_name
=
'
two_factor/core/two_factor_required.html
'
template_name
=
'
two_factor/core/two_factor_required.html
'
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