www: parser: add parseTfaType helper

The tfa keys can now contain the type as additional
information, so let's parse it out.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-04-11 11:31:59 +02:00 committed by Thomas Lamprecht
parent 50866ae1dc
commit 55ad23abd1

View File

@ -561,6 +561,19 @@ Ext.define('PVE.Parser', { statics: {
return res;
},
parseTfaType: function(value) {
var match;
if (!value || !value.length) {
return undefined;
} else if (value === 'x!oath') {
return 'totp';
} else if (match = value.match(/^x!(.+)$/)) {
return match[1];
} else {
return 1;
}
},
parseQemuCpu: function(value) {
if (!value) {
return {};