-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from jupyterhub/confirm-passwords
Ask for new passwords twice, ask for current password on change
- Loading branch information
Showing
6 changed files
with
187 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block script %} | ||
{{ super() }} | ||
<script type="text/javascript"> | ||
document.addEventListener('DOMContentLoaded', function() { | ||
let button = document.getElementById('eye'); | ||
button.addEventListener("click", function(e) { | ||
let npwd = document.getElementById("new_password_input"); | ||
let cpwd = document.getElementById("new_password_confirmation_input"); | ||
if (npwd.getAttribute("type") === "password") { | ||
npwd.setAttribute("type", "text"); | ||
cpwd.setAttribute("type", "text"); | ||
button.textContent = "🔑"; | ||
} else { | ||
npwd.setAttribute("type", "password"); | ||
cpwd.setAttribute("type", "password"); | ||
button.textContent = "👁"; | ||
} | ||
}); | ||
}); | ||
</script> | ||
{% endblock script %} | ||
|
||
{% block main %} | ||
<div class="container"> | ||
<form action="{{post_url}}" method="post" role="form"> | ||
<h1> | ||
Change password for {{user_name}} | ||
</h1> | ||
|
||
<p>Please enter the new password you want to set for {{user_name}}.</p> | ||
|
||
<div class="form-group"> | ||
<label for="new_password_input">New password:</label> | ||
<div class="input-group col-xs-6"> | ||
<input id="new_password_input" type="password" name="new_password" val="" autocapitalize="off" autocorrect="off" class="form-control" /> | ||
<span class="input-group-addon"> | ||
<button id="eye" type="button" style="border:0;">👁</button> | ||
</span> | ||
</div> | ||
<p></p> | ||
|
||
<label for="new_password_confirmation_input">Confirm new password:</label> | ||
<div class="input-group col-xs-6"> | ||
<input id="new_password_confirmation_input" type="password" name="new_password_confirmation" val="" autocapitalize="off" autocorrect="off" class="form-control" /> | ||
</div> | ||
<p></p> | ||
|
||
<input id="signup_submit" type="submit" value='Change Password' class='btn btn-jupyter' /> | ||
</div> | ||
</form> | ||
|
||
{% if result_message %} | ||
<div class="alert {{alert}} col-xs-6" role="alert">{{result_message}}</div> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.