diff --git a/plugins/plugins/core/components/qdn-action-types.js b/plugins/plugins/core/components/qdn-action-types.js index c574e1a5..1c359e06 100644 --- a/plugins/plugins/core/components/qdn-action-types.js +++ b/plugins/plugins/core/components/qdn-action-types.js @@ -111,3 +111,6 @@ export const GET_FRIENDS_LIST = 'GET_FRIENDS_LIST' // OPEN_PROFILE export const OPEN_PROFILE = 'OPEN_PROFILE' + +// GET_API_KEY +export const GET_API_KEY = 'GET_API_KEY' diff --git a/plugins/plugins/core/qdn/browser/browser.src.js b/plugins/plugins/core/qdn/browser/browser.src.js index 11393b43..f794fdb1 100644 --- a/plugins/plugins/core/qdn/browser/browser.src.js +++ b/plugins/plugins/core/qdn/browser/browser.src.js @@ -286,6 +286,26 @@ class WebBrowser extends LitElement { } } + case actions.GET_API_KEY: { + let res1 = await showModalAndWait( + actions.GET_API_KEY, + { + service: this.service, + name: this.name + } + ); + if (res1 && res1.action === 'accept') { + let apiKey = this.getApiKey(); + response = JSON.stringify({ apiKey }); + break; + } else { + const data = {}; + data['error'] = "User declined to share API key"; + response = JSON.stringify(data); + break; + } + } + case actions.ENCRYPT_DATA: { try { let dataSentBack = {} @@ -3801,6 +3821,14 @@ async function showModalAndWait(type, data) { ` : ''} + ${type === actions.GET_API_KEY ? ` +
${`${data.service.toLowerCase()} wants to access your API key.`}
+Allow ${data.service.toLowerCase()} to access your API key?
+Please confirm your approval.
+${get("browserpage.bchange19")}