Maybe we should add the reverse of PasswordCredential(HTMLFormElement) to populate a form from a PasswordCredential.
Use case:
A website that has existing logic to asynchronously sign-in the user from form data and verify the successful login, could use the function to populate the form.
Note that this could rely on autocomplete attributes or passing in a mapping of fields (fill input[name=username] with credential.id could be passed as {'username': 'id'}). At that points it raises the question whether we should just rely on document.querySelector('input[name=username]').value = credential.id for assignment. So maybe we don't need this?
Maybe we should add the reverse of
PasswordCredential(HTMLFormElement)
to populate a form from a PasswordCredential.Use case: A website that has existing logic to asynchronously sign-in the user from form data and verify the successful login, could use the function to populate the form.
Note that this could rely on autocomplete attributes or passing in a mapping of fields (fill
input[name=username]
withcredential.id
could be passed as{'username': 'id'}
). At that points it raises the question whether we should just rely ondocument.querySelector('input[name=username]').value = credential.id
for assignment. So maybe we don't need this?