verygoodsecurity / vgs-collect-js

VGS Collect.js script loading module
https://www.verygoodsecurity.com/
7 stars 14 forks source link

Prevent browser from saving password #40

Open victorevector opened 2 years ago

victorevector commented 2 years ago

This isn't a bug, but I was curious to get some feedback. I use VGS collect to collect a one-time pin from users. I would like to prevent the browser from prompting the user to save the pin as a "password". Does this library support a use-case like that?

AnnaKudriasheva commented 2 years ago

@victorevector I can suggest using input type text with masking:

const name = form.field('#card-name', {
  type: 'text',
  name: 'pin',
  validations: ['required'],
}).mask('9999', '*');

Would that be a suitable option for you?

dleis612 commented 2 years ago

@AnnaKudriasheva I attempted to use this solution, but ran into some issues. First, when the input gains focus, it automatically populates with the mask '****'. Then, when I type numbers into the field, the mask updates to show a combination of numbers and '*' (something like '12**'). If I were to input 4 numbers, it would look like this: '1234'. The desired functionality would be to replicate an input field of type password, but not allow Chrome to save the value. Any help would be greatly appreciated!