Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
fix(popup): encodeURIComponent all query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
doktordirk committed May 18, 2016
1 parent 7f45154 commit 82e023c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/baseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ' ',
Expand All @@ -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() {
Expand All @@ -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: ' ',
Expand All @@ -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: ' ',
Expand All @@ -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',
Expand All @@ -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'],
Expand All @@ -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: '+',
Expand Down
2 changes: 1 addition & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(',');
};
Expand Down

0 comments on commit 82e023c

Please sign in to comment.