kinetex - v1.0.0-rc.1
    Preparing search index...

    Function createAuthInterceptor

    • Create an auth interceptor pair (request + response) that injects Bearer tokens and handles 401-driven token refresh with request queueing and circuit-breaker.

      Parameters

      • config: Partial<AuthInterceptorConfig> & {
            getToken: () => string | Promise<string | null> | null;
        }

        Auth configuration (must include getToken; refreshToken and other fields are optional)

      Returns {
          requestInterceptor: RequestInterceptorFn;
          responseInterceptor: ResponseInterceptorFn;
      }

      • requestInterceptor: RequestInterceptorFn

        Injects the current token into outgoing request headers

      • responseInterceptor: ResponseInterceptorFn

        Handles 401 responses by triggering token refresh and retry