Skip to content

Commit

Permalink
Add 2 factor auth on login template
Browse files Browse the repository at this point in the history
  • Loading branch information
leportella committed Mar 4, 2019
1 parent 1a4efcd commit 0756327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions nativeauthenticator/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _render(self, login_error=None, username=None):
login_error=login_error,
custom_html=self.authenticator.custom_html,
login_url=self.settings['login_url'],
second_factor_auth=self.authenticator.add_two_factor_authentication,
authenticator_login_url=url_concat(
self.authenticator.login_url(self.hub.base_url),
{'next': self.get_argument('next', '')},
Expand Down
7 changes: 6 additions & 1 deletion nativeauthenticator/templates/native-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
</p>
{% endif %}
<label for="username_input">Username:</label>
<input id="username_input" type="text" autocapitalize="off" autocorrect="off" class="form-control" name="username" val="{{username}}" tabindex="1" autofocus="autofocus" />
<input id="username_input" type="text" autocapitalize="off" autocorrect="off" class="form-control" name="username" val="{{username}}"
tabindex="1" autofocus="autofocus" />
{% if second_factor_auth %}
<label for="2auth_input">Second auth factor:</label>
<input id="2auth_input" type="text" autocapitalize="off" autocorrect="off" class="form-control" name="2auth" tabindex="1" autofocus="autofocus" />
{% endif %}
<label for='password_input'>Password:</label>
<div class="input-group">
<input type="password" class="form-control" name="password" id="password_input" tabindex="2" />
Expand Down

0 comments on commit 0756327

Please sign in to comment.