From ec1ba7a124f69ec221d7562a338c37f3248f4ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Thu, 6 Apr 2017 06:08:52 +0200 Subject: [PATCH] fix most lint errors --- src/core/oauth2-authorize.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/oauth2-authorize.js b/src/core/oauth2-authorize.js index 18f92985..d905de4e 100644 --- a/src/core/oauth2-authorize.js +++ b/src/core/oauth2-authorize.js @@ -34,12 +34,11 @@ export default function authorize ( auth, authActions, errActions, configs ) { + "&state=" + encodeURIComponent(state) + "&client_id=" + encodeURIComponent(clientId) - console.log(flow); if (flow === "application") { fetch(schema.get("tokenUrl"), { - method: 'post', headers: { - 'Accept':'application/json, text/plain, */*', - 'Content-Type': 'application/x-www-form-urlencoded' + method: "post", headers: { + "Accept":"application/json, text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded" }, body: "grant_type=client_credentials" + "&client_id=" + encodeURIComponent(clientId) + @@ -49,12 +48,12 @@ export default function authorize ( auth, authActions, errActions, configs ) { .then(function (response) { response.json() .then(function (json){ - authActions.authorizeOauth2( { auth, token: json } ); - }); + authActions.authorizeOauth2({ auth, token: json }) + }) }) .catch (function (error) { - console.log('POST Request failed', error); - }); + console.log("POST Request failed", error) + }) } else { // pass action authorizeOauth2 and authentication data through window // to authorize with oauth2