mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Add Secure Text option for prompts (#1036)
* Add Secure Text option for prompts closes #962 * Change prompt secure text name
This commit is contained in:
parent
26e9b646bd
commit
caeb642fd2
@ -38,9 +38,23 @@ module.exports.templateTags = [
|
||||
'If this is set, the value will be stored in memory under this key until the app is ' +
|
||||
"closed. To force this tag to re-prompt the user, simply change this key's value to " +
|
||||
'something else.'
|
||||
},
|
||||
{
|
||||
displayName: 'Mask Text',
|
||||
type: 'boolean',
|
||||
help:
|
||||
'If this is enabled, the value when input will be masked like a password field.',
|
||||
defaultValue: false
|
||||
}
|
||||
],
|
||||
async run(context, title, label, defaultValue, explicitStorageKey) {
|
||||
async run(
|
||||
context,
|
||||
title,
|
||||
label,
|
||||
defaultValue,
|
||||
explicitStorageKey,
|
||||
maskText
|
||||
) {
|
||||
if (!title) {
|
||||
throw new Error('Title attribute is required for prompt tag');
|
||||
}
|
||||
@ -60,7 +74,8 @@ module.exports.templateTags = [
|
||||
|
||||
const value = await context.app.prompt(title || 'Enter Value', {
|
||||
label,
|
||||
defaultValue
|
||||
defaultValue,
|
||||
inputType: maskText ? 'password' : 'text'
|
||||
});
|
||||
|
||||
if (storageKey) {
|
||||
|
Loading…
Reference in New Issue
Block a user