How to access jwt plugin header in `hooks.after`

I have a case, where I need to set one more auth cookie with JWT payload. I tried to simply using hooks.after but it seems to have empty headers, but I see set-auth-jwt in real response.

Does the plugin hook run after the hooks.after?

Example code which logs empty object:
  hooks: {
    after: createAuthMiddleware(async (ctx) => {
      if (ctx.path === "/get-session") {
        const responseHeaders = ctx.context.responseHeaders;
        console.log(responseHeaders)
      }

      return;
    }),
  },
Was this page helpful?