Permalink
Browse files

fix(popup): encodeURIComponent all query parameters

  • Loading branch information...
doktordirk committed May 18, 2016
1 parent 7f45154 commit 82e023c25eaae01b99deaf53a6350ffe46756fb9
Showing with 8 additions and 8 deletions.
  1. +7 −7 src/baseConfig.js
  2. +1 −1 src/popup.js
@@ -132,7 +132,7 @@ export class BaseConfig {
name: 'google',
url: '/auth/google',
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
scope: ['profile', 'email'],
scopePrefix: 'openid',
scopeDelimiter: ' ',
@@ -149,7 +149,7 @@ export class BaseConfig {
name: 'facebook',
url: '/auth/facebook',
authorizationEndpoint: 'https://www.facebook.com/v2.3/dialog/oauth',
redirectUri: encodeURI(window.location.origin + '/' || window.location.protocol + '//' + window.location.host + '/'),
redirectUri: window.location.origin + '/' || window.location.protocol + '//' + window.location.host + '/',
scope: ['email'],
scopeDelimiter: ',',
nonce: function() {
@@ -167,7 +167,7 @@ export class BaseConfig {
name: 'linkedin',
url: '/auth/linkedin',
authorizationEndpoint: 'https://www.linkedin.com/uas/oauth2/authorization',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
requiredUrlParams: ['state'],
scope: ['r_emailaddress'],
scopeDelimiter: ' ',
@@ -182,7 +182,7 @@ export class BaseConfig {
name: 'github',
url: '/auth/github',
authorizationEndpoint: 'https://github.com/login/oauth/authorize',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
optionalUrlParams: ['scope'],
scope: ['user:email'],
scopeDelimiter: ' ',
@@ -196,7 +196,7 @@ export class BaseConfig {
name: 'yahoo',
url: '/auth/yahoo',
authorizationEndpoint: 'https://api.login.yahoo.com/oauth2/request_auth',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
scope: [],
scopeDelimiter: ',',
type: '2.0',
@@ -219,7 +219,7 @@ export class BaseConfig {
name: 'live',
url: '/auth/live',
authorizationEndpoint: 'https://login.live.com/oauth20_authorize.srf',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
scope: ['wl.emails'],
scopeDelimiter: ' ',
requiredUrlParams: ['display', 'scope'],
@@ -234,7 +234,7 @@ export class BaseConfig {
name: 'instagram',
url: '/auth/instagram',
authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
redirectUri: encodeURI(window.location.origin || window.location.protocol + '//' + window.location.host),
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
requiredUrlParams: ['scope'],
scope: ['basic'],
scopeDelimiter: '+',
@@ -107,7 +107,7 @@ const buildPopupWindowOptions = options => {
}, options);
let parts = [];
Object.keys(extended).map(key => parts.push(key + '=' + extended[key]));
Object.keys(extended).map(key => parts.push(key + '=' + encodeURIComponent(extended[key])));
return parts.join(',');
};

0 comments on commit 82e023c

Please sign in to comment.