[Coquelicot] Browser prompt to save simplepass password

Wolfgang Wiedmeyer wolfgit at wiedmeyer.de
Tue Oct 11 16:03:53 CEST 2016


Hi,

many thanks for your work on this great project and for maintaining it
in Debian!

The simplepass authentication method is all I need to restrict access to
the upload interface. The only issue is that browsers like Firefox or
Chromium don't offer to save the upload password. So users have to find
other ways to save the password.
I did a little bit of digging and it seems that Firefox and Chromium
only offer to save the password if a username input element is supplied
in the same form alongside the password input element. As a workaround,
I added a dummy username input field that is used for nothing and it
worked. I attached the diff.
Unfortunately, I didn't check the mailing list. Otherwise, I would have
seen the patch from Rowan Thorpe that adds a userpass authentication. I
didn't test the patch but it looks like adding only one account with the
userpass auth method would solve the issue, too.

Best regards,
Wolfgang

---
 public/javascripts/coquelicot.auth.simplepass.js | 11 +++++++++++
 views/auth/simplepass.haml                       |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/public/javascripts/coquelicot.auth.simplepass.js b/public/javascripts/coquelicot.auth.simplepass.js
index 3fd3626..db4c5f7 100644
--- a/public/javascripts/coquelicot.auth.simplepass.js
+++ b/public/javascripts/coquelicot.auth.simplepass.js
@@ -30,3 +30,14 @@ var authentication = {
     $('#upload_password').val('');
   },
 };
+
+$(document).ready(function() {
+  $('#simplepass-auth-submit').remove();
+  var submit = $('<input type="submit" />');
+  submit.attr('value', 'Login');
+  submit.attr('id', 'simplepass-auth-submit');
+  $('#upload-authentication').append(
+    $('<div class="field" />').append(
+      $('<div class="submit" />').append(
+	submit)));
+});
diff --git a/views/auth/simplepass.haml b/views/auth/simplepass.haml
index 04809e2..8374a83 100644
--- a/views/auth/simplepass.haml
+++ b/views/auth/simplepass.haml
@@ -16,5 +16,8 @@
 -# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 .field
+  %label Upload User:
+  %input.input{ :type => 'text', :name => 'upload_user' }
+.field
   %label{ :for => 'upload_password' } Upload password:
   %input.input{ :type => 'password', :id => 'upload_password', :name => 'upload_password' }
-- 
Website: https://fossencdi.org
OpenPGP: 0F30 D1A0 2F73 F70A 6FEE  048E 5816 A24C 1075 7FC4
Key download: https://wiedmeyer.de/keys/ww.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://listes.potager.org/pipermail/coquelicot/attachments/20161011/d78f78be/attachment.sig>


More information about the Coquelicot mailing list