liangyali / passport-wechat

Passport strategy for authenticating with Wechat
158 stars 51 forks source link

传入配置时 appID 能否改为 clientID ? #23

Open flight9 opened 6 years ago

flight9 commented 6 years ago

在与其他项目整合时, 比如: https://github.com/feathersjs/authentication-oauth2

问题 1

他们使用的是 clientID 和 clientSecret:

app.configure(oauth2({
  name: 'facebook',
  Strategy: FacebookStrategy,
  clientID: '<your client id>',
  clientSecret: '<your client secret>',
  scope: ['public_profile', 'email']
}));

我们项目上用 appID, appSecret 这样命名上不一致在配置时可能出错, 是否可以考虑和他们统一?

flight9 commented 6 years ago

问题2

代码中 https://github.com/liangyali/passport-wechat/blob/48e3ea4706a9604fa13f91f0300767119080d32f/lib/strategy.js#L110 第5个参数为何是传入 expires_in 而不是 done 函数?

Jeff-Tian commented 5 years ago

问题2

代码中

https://github.com/liangyali/passport-wechat/blob/48e3ea4706a9604fa13f91f0300767119080d32f/lib/strategy.js#L110

第5个参数为何是传入 expires_in 而不是 done 函数?

你说的 done 函数,在这里就是 verified 函数吧。

在与其他项目整合时, 比如: https://github.com/feathersjs/authentication-oauth2

问题 1

他们使用的是 clientID 和 clientSecret:

app.configure(oauth2({
  name: 'facebook',
  Strategy: FacebookStrategy,
  clientID: '<your client id>',
  clientSecret: '<your client secret>',
  scope: ['public_profile', 'email']
}));

我们项目上用 appID, appSecret 这样命名上不一致在配置时可能出错, 是否可以考虑和他们统一?

这个可以自行 map 一下解决掉吧。

Jeff-Tian commented 5 years ago

image

在接入 egg-passport-xxx 时,碰到这种 map 是很常见的。