Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(oauth): look for the correct 'scope' param in oauth response, not…
Browse files Browse the repository at this point in the history
… 'scopes'
  • Loading branch information
rfk committed Nov 16, 2015
1 parent 4c62ecf commit 7fc5030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/routes/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ module.exports = function (
if (auth.strategy === 'sessionToken') {
return true
}
var scopes = auth.credentials.scopes
var scopes = auth.credentials.scope
for (var i = 0; i < scopes.length; i++) {
if (scopes[i] === 'profile') {
return true
Expand Down
16 changes: 8 additions & 8 deletions test/remote/account_profile_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TestServer.start(config)
return c.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: c.uid,
scopes: ['profile']
scope: ['profile']
})
})
}
Expand Down Expand Up @@ -96,7 +96,7 @@ TestServer.start(config)
return c.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: UNKNOWN_UID,
scopes: ['profile']
scope: ['profile']
})
})
}
Expand All @@ -122,7 +122,7 @@ TestServer.start(config)
return c.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: c.uid,
scopes: ['readinglist', 'payments']
scope: ['readinglist', 'payments']
})
})
}
Expand All @@ -146,7 +146,7 @@ TestServer.start(config)
return client.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: client.uid,
scopes: ['profile:email']
scope: ['profile:email']
})
})
}
Expand All @@ -162,7 +162,7 @@ TestServer.start(config)
return client.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: client.uid,
scopes: ['profile:locale']
scope: ['profile:locale']
})
})
}
Expand All @@ -187,7 +187,7 @@ TestServer.start(config)
return client.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: client.uid,
scopes: ['profile:write']
scope: ['profile:write']
})
})
}
Expand All @@ -203,7 +203,7 @@ TestServer.start(config)
return client.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: client.uid,
scopes: ['profile:locale:write', 'readinglist']
scope: ['profile:locale:write', 'readinglist']
})
})
}
Expand All @@ -219,7 +219,7 @@ TestServer.start(config)
return client.api.accountProfile(null, {
Authorization: makeMockOAuthHeader({
user: client.uid,
scopes: ['storage', 'profile:email:write']
scope: ['storage', 'profile:email:write']
})
})
}
Expand Down

0 comments on commit 7fc5030

Please sign in to comment.