Skip to content

Commit 8542959

Browse files
syffspi0
authored andcommitted
feat: allow providers params to be overloaded from nuxt.config.js (#77)
1 parent be65f09 commit 8542959

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

examples/demo/nuxt.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ module.exports = {
3333
client_id: 'q8lDHfBLJ-Fsziu7bf351OcYQAIe3UJv'
3434
},
3535
facebook: {
36-
client_id: '1671464192946675'
36+
client_id: '1671464192946675',
37+
userinfo_endpoint: 'https://graph.facebook.com/v2.12/me?fields=about,name,picture{url},email,birthday',
38+
scope: ['public_profile', 'email', 'user_birthday']
3739
},
3840
google: {
3941
client_id:

lib/auth/providers/_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const axios = require('axios')
22
const bodyParser = require('body-parser')
33

44
function assignDefaults (strategy, defaults) {
5-
Object.assign(strategy, defaults, strategy)
5+
Object.assign(strategy, Object.assign({}, defaults, strategy))
66
}
77

88
function addAuthorize (strategy) {

lib/module.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ function processStrategy (strategy, name, ctx) {
114114
strategy._provider = strategy._name
115115
}
116116

117-
// _scheme property
118-
if (!strategy._scheme) {
119-
strategy._scheme = strategy._name
120-
}
121-
122117
// Apply provider
123118
if (ctx.providers[strategy._provider]) {
124119
ctx.providers[strategy._provider].call(this, strategy, ctx)
125120
}
126121

122+
// _scheme property
123+
if (!strategy._scheme) {
124+
strategy._scheme = strategy._name
125+
}
126+
127127
// Resolve _scheme
128128
if (SCHEMES.includes(strategy._scheme)) {
129129
strategy._scheme = `./schemes/${strategy._scheme}.js`

0 commit comments

Comments
 (0)