openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

How to add refresh token logic?

Open karkigrishmin opened this issue 5 months ago • 0 comments

I'm using auto generated service.gen.ts and core.ts file. In layout.tsx file for passing token in header I have done like this:

  useEffect(() => {
    OpenAPI.interceptors.request.use((config) => {
      const { token } = getToken()

      config.headers = {
        Authorization: token ? `Bearer ${token}` : '',
      }
      return config
    })
  }, [])

Similarly, how to add refresh token logic?

cc: @7nohe

karkigrishmin avatar Sep 26 '24 03:09 karkigrishmin