How do I do this in Passport.js?:
When the access token expires, you can use the refresh_token to \"refresh\" your access, and gain another access_token
answer from Jared Hanson, author PassportJS:
Refresh tokens are something handled entirely on the backend, and not connected to a user's session. For example: set up a cron job, query for tokens about to expire, make POST requests to refresh them.
Passport doesn't get involved in this process, because its separate from authentication.
I asked Jared if he would consider adding something into the core to make this a little easier to handle. He responded by saying that this should not be handled in the core.
So I wrote a plugin to help: https://github.com/fiznool/passport-oauth2-refresh