From caeb642fd2b1ebdecc845fff6b3e48f2a9fe0e98 Mon Sep 17 00:00:00 2001 From: Phillip Lanclos Date: Thu, 5 Jul 2018 16:44:45 -0500 Subject: [PATCH] Add Secure Text option for prompts (#1036) * Add Secure Text option for prompts closes #962 * Change prompt secure text name --- plugins/insomnia-plugin-prompt/index.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/insomnia-plugin-prompt/index.js b/plugins/insomnia-plugin-prompt/index.js index 239cab6f7..37bd50ab2 100644 --- a/plugins/insomnia-plugin-prompt/index.js +++ b/plugins/insomnia-plugin-prompt/index.js @@ -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) {