Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
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
Contributor 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
Pinguin
AlekSIS-Core
Commits
2c42d8ff
Commit
2c42d8ff
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '507-2fa-login-form-requires-otp-multiple-times' into 'master'
Resolve "[2FA] Login form requires otp multiple times" Closes
#507
See merge request
!743
parents
963b8889
ded8106b
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
CHANGELOG.rst
+9
-0
9 additions, 0 deletions
CHANGELOG.rst
aleksis/core/templates/two_factor/core/login.html
+100
-92
100 additions, 92 deletions
aleksis/core/templates/two_factor/core/login.html
with
109 additions
and
92 deletions
CHANGELOG.rst
+
9
−
0
View file @
2c42d8ff
...
@@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
...
@@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Fixed
~~~~~
* Fix order of submit buttons in login form and restructure login template
to make 2FA work correctly.
`2.0rc7`_ - 2021-10-18
`2.0rc7`_ - 2021-10-18
----------------------
----------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/templates/two_factor/core/login.html
+
100
−
92
View file @
2c42d8ff
...
@@ -9,110 +9,118 @@
...
@@ -9,110 +9,118 @@
{% block content %}
{% block content %}
{% get_providers as socialaccount_providers %}
{% get_providers as socialaccount_providers %}
<div
class=
"row"
>
<form
action=
""
method=
"post"
>
<div
class=
"col m1 l2 xl3"
></div>
{% csrf_token %}
<div
class=
"col s12 m10 l8 xl6"
>
<div
class=
"row"
>
<div
class=
"card"
>
<div
class=
"col m1 l2 xl3"
></div>
<div
class=
"card-content"
>
<div
class=
"col s12 m10 l8 xl6"
>
{% if wizard.steps.current == 'auth' and socialaccount_providers %}
<div
class=
"card"
>
<div
class=
"card-title"
>
{% trans "Login with username and password" %}
</div>
<div
class=
"card-content"
>
{% else %}
{% if wizard.steps.current == 'auth' and socialaccount_providers %}
<div
class=
"card-title"
>
{% trans "Login" %}
</div>
<div
class=
"card-title"
>
{% trans "Login with username and password" %}
</div>
{% endif %}
{% else %}
{% if wizard.steps.current == "auth" and user.is_authenticated %}
<div
class=
"card-title"
>
{% trans "Login" %}
</div>
<div
class=
"alert warning"
>
{% endif %}
<p>
{% if wizard.steps.current == "auth" and user.is_authenticated %}
<i
class=
"material-icons left"
>
warning
</i>
<div
class=
"alert warning"
>
{% blocktrans %}You have no permission to view this page. Please login with an other account.{% endblocktrans %}
<p>
</p>
<i
class=
"material-icons left"
>
warning
</i>
</div>
{% blocktrans %}You have no permission to view this page. Please login with an other
{% elif wizard.steps.current == 'auth' %}
account.{% endblocktrans %}
<div
class=
"alert primary"
>
</p>
<p>
</div>
<i
class=
"material-icons left"
>
info
</i>
{% elif wizard.steps.current == 'auth' %}
{% blocktrans %}Please login to see this page.{% endblocktrans %}
<div
class=
"alert primary"
>
</p>
<p>
</div>
<i
class=
"material-icons left"
>
info
</i>
{% endif %}
{% blocktrans %}Please login to see this page.{% endblocktrans %}
{% if not wizard.steps.current == "auth" %}
</p>
<div
class=
"alert primary"
>
</div>
<p>
{% endif %}
<i
class=
"material-icons left"
>
info
</i>
{% if not wizard.steps.current == "auth" %}
{% if wizard.steps.current == 'token' %}
<div
class=
"alert primary"
>
{% if device.method == 'call' %}
<p>
{% blocktrans %}
<i
class=
"material-icons left"
>
info
</i>
We are calling your phone right now, please enter the
{% if wizard.steps.current == 'token' %}
digits you hear.
{% if device.method == 'call' %}
{% endblocktrans %}
{% blocktrans %}
{% elif device.method == 'sms' %}
We are calling your phone right now, please enter the
{% blocktrans %}
digits you hear.
We sent you a text message, please enter the tokens we
{% endblocktrans %}
sent.
{% elif device.method == 'sms' %}
{% endblocktrans %}
{% blocktrans %}
{% else %}
We sent you a text message, please enter the tokens we
sent.
{% endblocktrans %}
{% else %}
{% blocktrans %}
Please enter the tokens generated by your token
generator.
{% endblocktrans %}
{% endif %}
{% elif wizard.steps.current == 'backup' %}
{% blocktrans %}
{% blocktrans %}
Please enter the tokens generated by your token
Use this form for entering backup tokens for logging in.
generator.
These tokens have been generated for you to print and keep safe. Please
enter one of these backup tokens to login to your account.
{% endblocktrans %}
{% endblocktrans %}
{% endif %}
{% endif %}
{% elif wizard.steps.current == 'backup' %}
</p>
{% blocktrans %}
</div>
Use this form for entering backup tokens for logging in.
{% endif %}
These tokens have been generated for you to print and keep safe. Please
enter one of these backup tokens to login to your account.
{% endblocktrans %}
{% endif %}
</p>
</div>
{% endif %}
<form
id=
"login_form"
action=
""
method=
"post"
>
{% csrf_token %}
{% include "two_factor/_wizard_forms.html" %}
{% include "two_factor/_wizard_forms.html" %}
</div>
{% if other_devices %}
<div
class=
"card-action-light"
>
<p>
{% trans "Or, alternatively, use one of your backup phones:" %}
</p>
<button
type=
"submit"
class=
"btn green waves-effect waves-light"
>
<p>
{% trans "Login" %}
{% for other in other_devices %}
<i
class=
"material-icons right"
>
send
</i>
<button
name=
"challenge_device"
value=
"{{ other.persistent_id }}"
class=
"btn"
type=
"submit"
>
</button>
{{ other|device_action }}
{% if request.site.preferences.auth__allow_password_change and wizard.steps.current == "auth" %}
</button>
<a
href=
"{% url "
account_reset_password
"
%}"
class=
"btn-flat right waves-effect waves-light"
>
{% endfor %}
{% trans "Reset password" %}
</p>
</a>
{% endif %}
{% if backup_tokens %}
<p>
{% trans "As a last resort, you can use a backup token:" %}
</p>
<p>
<button
name=
"wizard_goto_step"
type=
"submit"
value=
"backup"
class=
"btn"
>
{% trans "Use Backup Token" %}
</button>
</p>
{% endif %}
{% endif %}
</form>
</div>
</div>
<div
class=
"card-action-light"
>
<button
form=
"login_form"
type=
"submit"
class=
"btn green waves-effect waves-light"
>
{% trans "Login" %}
<i
class=
"material-icons right"
>
send
</i>
</button>
{% if request.site.preferences.auth__allow_password_change %}
<a
href=
"{% url "
account_reset_password
"
%}"
class=
"btn-flat right waves-effect waves-light"
>
{% trans "Reset password" %}
</a>
{% endif %}
</div>
</div>
</div>
{% if wizard.steps.current == 'auth' and socialaccount_providers %}
{% if other_devices or backup_tokens %}
<div
class=
"card"
>
<div
class=
"card"
>
<div
class=
"card-content"
>
<div
class=
"card-content"
>
<div
class=
"card-title"
>
{% trans "Device currently not available?" %}
</div>
{% if other_devices %}
<p>
{% trans "Or, alternatively, use one of your backup phones:" %}
</p>
<p>
{% for other in other_devices %}
<button
name=
"challenge_device"
value=
"{{ other.persistent_id }}"
class=
"btn"
type=
"submit"
>
{{ other|device_action }}
</button>
{% endfor %}
</p>
{% endif %}
{% if backup_tokens %}
<p>
{% trans "As a last resort, you can use a backup token:" %}
</p>
<p>
<button
name=
"wizard_goto_step"
type=
"submit"
value=
"backup"
class=
"btn"
>
{% trans "Use Backup Token" %}
</button>
</p>
{% endif %}
</div>
</div>
{% endif %}
{% if wizard.steps.current == 'auth' and socialaccount_providers %}
<div
class=
"card"
>
<div
class=
"card-content"
>
<div
class=
"card-title"
>
<div
class=
"card-title"
>
{% trans "Use alternative login options" %}
{% trans "Use alternative login options" %}
</div>
</div>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% endblock %}
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