From 99b2f045af31461431fecbb172f9365dde6a1557 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 1 Feb 2021 14:53:45 +0100 Subject: [PATCH] ui: tfa: add auto-fill button for webAuthn setup Signed-off-by: Thomas Lamprecht --- www/config/WebauthnView.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/www/config/WebauthnView.js b/www/config/WebauthnView.js index 8f68ac00..b23e813a 100644 --- a/www/config/WebauthnView.js +++ b/www/config/WebauthnView.js @@ -82,5 +82,26 @@ Ext.define('PBS.WebauthnConfigEdit', { name: 'id', allowBlank: false, }, + { + xtype: 'container', + layout: 'hbox', + items: [ + { + xtype: 'box', + flex: 1, + }, + { + xtype: 'button', + text: gettext('Auto-fill'), + iconCls: 'fa fa-fw fa-pencil-square-o', + handler: function(button, ev) { + let panel = this.up('panel'); + panel.down('field[name=rp]').setValue(document.location.hostname); + panel.down('field[name=origin]').setValue(document.location.origin); + panel.down('field[name=id]').setValue(document.location.hostname); + }, + }, + ], + }, ], });