Function getAuthHeader
- get
Auth (token, prefix?): AuthHeaderHeader -
Parameters
-
token: string
The token used for authentication.
-
prefix: string = 'Bearer'
The prefix to be added before the token (default is 'Bearer').
Returns AuthHeader
The authentication header.
Example
//Generating a custom prefix token header
const token = 'your-custom-token';
const customPrefix = 'Custom';
const header = getAuthHeader(token, customPrefix);
// header will be: { Authorization: 'Custom your-custom-token' } -
Generated using TypeDoc
Generates an authentication header using the provided token and optional prefix.