mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +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 ' +
|
'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 " +
|
"closed. To force this tag to re-prompt the user, simply change this key's value to " +
|
||||||
'something else.'
|
'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) {
|
if (!title) {
|
||||||
throw new Error('Title attribute is required for prompt tag');
|
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', {
|
const value = await context.app.prompt(title || 'Enter Value', {
|
||||||
label,
|
label,
|
||||||
defaultValue
|
defaultValue,
|
||||||
|
inputType: maskText ? 'password' : 'text'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (storageKey) {
|
if (storageKey) {
|
||||||
|
Loading…
Reference in New Issue
Block a user