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:
parent
50866ae1dc
commit
55ad23abd1
@ -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 {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user