Skip to content

Commit

Permalink
Merge 5daede8 into da51d9d
Browse files Browse the repository at this point in the history
  • Loading branch information
bitkidd committed Oct 23, 2019
2 parents da51d9d + 5daede8 commit 0f468fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Drivers/Facebook.js
Expand Up @@ -91,7 +91,7 @@ class Facebook extends OAuth2Scheme {
* @return {String}
*/
get baseUrl () {
return 'https://graph.facebook.com/v2.1'
return 'https://graph.facebook.com/v4.0'
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/drivers.spec.js
Expand Up @@ -185,7 +185,7 @@ test.group('Oauth Drivers | Facebook', function () {
const facebook = new Facebook(config)
const redirectUrl = qs.escape(config.get().redirectUri)
const scope = qs.escape(['email'].join(','))
const providerUrl = `https://graph.facebook.com/v2.1/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${config.get().clientId}`
const providerUrl = `https://graph.facebook.com/v4.0/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${config.get().clientId}`
const redirectToUrl = await facebook.getRedirectUrl()
assert.equal(redirectToUrl, providerUrl)
})
Expand All @@ -204,7 +204,7 @@ test.group('Oauth Drivers | Facebook', function () {
const facebook = new Facebook(customConfig)
const redirectUrl = qs.escape(customConfig.get().redirectUri)
const scope = qs.escape(['email', 'name'].join(','))
const providerUrl = `https://graph.facebook.com/v2.1/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${customConfig.get().clientId}`
const providerUrl = `https://graph.facebook.com/v4.0/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${customConfig.get().clientId}`
const redirectToUrl = await facebook.getRedirectUrl()
assert.equal(redirectToUrl, providerUrl)
})
Expand All @@ -213,7 +213,7 @@ test.group('Oauth Drivers | Facebook', function () {
const facebook = new Facebook(config)
const redirectUrl = qs.escape(config.get().redirectUri)
const scope = qs.escape(['foo'].join(','))
const providerUrl = `https://graph.facebook.com/v2.1/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${config.get().clientId}`
const providerUrl = `https://graph.facebook.com/v4.0/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&client_id=${config.get().clientId}`

facebook.scope = ['foo']
const redirectToUrl = await facebook.getRedirectUrl()
Expand Down Expand Up @@ -254,7 +254,7 @@ test.group('Oauth Drivers | Facebook', function () {
const scope = qs.escape(['email'].join(','))
const state = '1234'

const providerUrl = `https://graph.facebook.com/v2.1/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&state=${state}&client_id=${config.get().clientId}`
const providerUrl = `https://graph.facebook.com/v4.0/oauth/authorize?redirect_uri=${redirectUrl}&scope=${scope}&response_type=code&state=${state}&client_id=${config.get().clientId}`

const redirectToUrl = await facebook.getRedirectUrl(state)
assert.equal(redirectToUrl, providerUrl)
Expand Down

0 comments on commit 0f468fa

Please sign in to comment.