Core
basicAuthSSEInterceptor
SSE interceptor that sets an Authorization: Basic … header from credentials.
@defjs/core · Function
Signature
function basicAuthSSEInterceptor( fn: () => BasicCredential, options?: BasicAuthInterceptorOptions, ): SSEInterceptor;
It sets Authorization: Basic <encoded> on a copy of the request headers,
replacing any existing Authorization header. Encoding and the btoa
requirement are the same as for basicAuthHttpInterceptor, including
the synchronous throw when btoa is missing.
Parameters
Prop
Type
fn () => BasicCredentialFactory returning username/password for each request.
options? BasicAuthInterceptorOptionsOptional custom encoder (defaults to btoa).
Returns
An SSEInterceptor that injects basic auth.