From 5be00cdb0d193d5ce7b3aa075a776ab72eeb3b23 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Tue, 16 Jan 2018 22:41:04 -0300 Subject: [PATCH 1/3] Added scope prop --- lib/providers/google.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/providers/google.js b/lib/providers/google.js index c397533..ab63646 100644 --- a/lib/providers/google.js +++ b/lib/providers/google.js @@ -22,7 +22,7 @@ import { toQueryString, } from '../utils/uri'; -const SCOPE = 'email profile'; +const SCOPE = 'email profile offline'; const AUTH = 'https://accounts.google.com/o/oauth2/v2/auth'; const TOKEN = 'https://www.googleapis.com/oauth2/v4/token'; const ME = 'https://www.googleapis.com/oauth2/v2/userinfo'; @@ -45,13 +45,13 @@ const getUser = curry((request, credentials) => pipe( ), )(credentials)); -export const authorize = ({ dance, request }, { appId, callback }) => +export const authorize = ({ dance, request }, { appId, callback, scope = SCOPE }) => pipeP( dance, fromQueryString, checkError, merge({ appId, callback }), - )(authorizationUrl(AUTH, appId, callback, SCOPE, 'code')); + )(authorizationUrl(AUTH, appId, callback, scope, 'code')); export const identify = curry((request, { appId, callback, code }) => pipeP( From 99a223d7b5da1970df5a2e41db1093220501e875 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Tue, 16 Jan 2018 22:42:05 -0300 Subject: [PATCH 2/3] Changed default scope --- lib/providers/google.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/providers/google.js b/lib/providers/google.js index ab63646..3f54d8d 100644 --- a/lib/providers/google.js +++ b/lib/providers/google.js @@ -22,7 +22,7 @@ import { toQueryString, } from '../utils/uri'; -const SCOPE = 'email profile offline'; +const SCOPE = 'email profile'; const AUTH = 'https://accounts.google.com/o/oauth2/v2/auth'; const TOKEN = 'https://www.googleapis.com/oauth2/v4/token'; const ME = 'https://www.googleapis.com/oauth2/v2/userinfo'; From fa905961ccfd0b6c2db9b408c5f31333cd9e5bd5 Mon Sep 17 00:00:00 2001 From: Ignacio Santise Date: Wed, 17 Jan 2018 10:58:40 -0300 Subject: [PATCH 3/3] Solved lint error --- lib/providers/google.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/providers/google.js b/lib/providers/google.js index 3f54d8d..55cbe45 100644 --- a/lib/providers/google.js +++ b/lib/providers/google.js @@ -45,7 +45,9 @@ const getUser = curry((request, credentials) => pipe( ), )(credentials)); -export const authorize = ({ dance, request }, { appId, callback, scope = SCOPE }) => +export const authorize = ( + { dance, request }, + { appId, callback, scope = SCOPE }) => pipeP( dance, fromQueryString,