From 66c449288e269cd4475a9575bf239b9325d9e876 Mon Sep 17 00:00:00 2001 From: MrCreeper1008 Date: Sat, 7 Oct 2017 20:07:43 +0800 Subject: [PATCH 1/2] Updated index.js function `electronOauth2(config, windowParams)` updated to allow custom options/query as an object. New: `electronOauth2(config, windowParams, customConfig)` --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 42698ce..da77d7b 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ var generateRandomString = function (length) { return text; }; -module.exports = function (config, windowParams) { +module.exports = function (config, windowParams, customConfig) { function getAuthorizationCode(opts) { opts = opts || {}; @@ -42,7 +42,7 @@ module.exports = function (config, windowParams) { urlParams.access_type = opts.accessType; } - var url = config.authorizationUrl + '?' + queryString.stringify(urlParams); + var url = config.authorizationUrl + '?' + queryString.stringify(urlParams) + "&" + queryString.stringify(customConfig); return new Promise(function (resolve, reject) { const authWindow = new BrowserWindow(windowParams || {'use-content-size': true}); From 18ffa7e6588c70e1eea5ff93684206984865d70b Mon Sep 17 00:00:00 2001 From: MrCreeper1008 Date: Sat, 7 Oct 2017 20:25:42 +0800 Subject: [PATCH 2/2] Update index.js Used single quotes for string instead of double quotes --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index da77d7b..11e9ac6 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ module.exports = function (config, windowParams, customConfig) { urlParams.access_type = opts.accessType; } - var url = config.authorizationUrl + '?' + queryString.stringify(urlParams) + "&" + queryString.stringify(customConfig); + var url = config.authorizationUrl + '?' + queryString.stringify(urlParams) + '&' + queryString.stringify(customConfig); return new Promise(function (resolve, reject) { const authWindow = new BrowserWindow(windowParams || {'use-content-size': true});