logaretm / villus

🏎 A tiny and fast GraphQL client for Vue.js

Home Page:https://villus.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to renew accessToken with subscription ?

rcauquil opened this issue · comments

Hi,
I'm looking for a way to renew the token using subscription when it has expired and connection is lost.
Any tips ?

ok I fixed it this way:

connectionParams: async () => {
    let accessToken = await authPlugin.getThrottledTokenSilently()
    return {
       headers: {
           Authorization: `Bearer ${accessToken}`
       }
    }
}