Merge pull request #2787 from nextcloud/password-field

show AIO password
This commit is contained in:
Simon L 2023-06-26 17:50:38 +02:00 committed by GitHub
commit 6747613a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View file

@ -39,6 +39,15 @@
document.getElementById('overlay').classList.remove('loading');
}
function showPassword(id) {
let passwordField = document.getElementById(id);
if (passwordField.type === "password" && passwordField.value !== "") {
passwordField.type = "text";
} else if (passwordField.type === "text" && passwordField.value === "") {
passwordField.type = "password";
}
}
function initForm(form) {
function submit(event)
{

View file

@ -509,8 +509,8 @@
<summary>Click here to change your AIO password</summary><br />
You can change your AIO password below:<br><br />
<form method="POST" action="/api/configuration" class="xhr">
<input type="text" autocomplete="current-password" name="current-master-password" placeholder="Your current AIO password"/>
<input type="text" autocomplete="new-password" name="new-master-password" placeholder="Your new AIO password"/>
<input type="password" autocomplete="current-password" name="current-master-password" placeholder="Your current AIO password" id="current-master-password" oninput="showPassword('current-master-password')">
<input type="password" autocomplete="new-password" name="new-master-password" placeholder="Your new AIO password" id="new-master-password" oninput="showPassword('new-master-password')">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input class="button" type="submit" value="Submit password change" />

View file

@ -8,7 +8,8 @@
{% if is_login_allowed == true %}
<p>Log in using your Nextcloud AIO password:</p>
<form method="POST" action="/api/auth/login" class="xhr">
<input type="text" autocomplete="off" name="password" placeholder="Password" />
<input type="password" autocomplete="current-password" name="password" placeholder="Password" id="master-password" oninput="showPassword('master-password')">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input type="submit" class="button" value="Log in" />