wechaty / puppet-official-account

Wechaty Puppet for WeChat Official Account
https://wechaty.js.org/2020/11/06/wechaty-puppet-oa-released-en/
Apache License 2.0
16 stars 7 forks source link

Refresh access token automatically before it expired #3

Closed huan closed 4 years ago

huan commented 4 years ago

The current design has a bug that only updates access token when there's a request.

However, this implementation will return the old(expired) access token when it starts the access token refreshing, which will cause the first reply will fail.

Need to use a setTimeout to proactive refresh it.

To be fixed.