Defjs
Core

BasicAuthInterceptorOptions

Options for basic-auth interceptors, including a custom credential encoder.

@defjs/core · Type

Signature

type BasicAuthInterceptorOptions = {
  encode?: (credential: BasicCredential) => string;
};

encode replaces only the credential encoder. The default is btoa(`${username}:${password}`). The interceptor always prefixes the returned string with Basic , so return the credential part alone: returning 'Basic abc' produces the header Basic Basic abc.

Accepted by basicAuthHttpInterceptor and basicAuthSSEInterceptor.

Members

Prop

Type

encode? ((credential: BasicCredential) => string) | undefined
Edit this page on GitHub
Released under the MIT License. · Copyright © 2026 MunMunMiao