Function getBasicAuthHeader

  • Generates a Basic authentication header using the provided username and password.

    Parameters

    • username: string

      The username for authentication.

    • password: string

      The password for authentication.

    Returns AuthHeader

    The Basic authentication header.

    Example

    // Generating a Basic authentication header
    const username = 'yourUsername';
    const password = 'yourPassword';
    const basicAuthHeader = getBasicAuthHeader(username, password);
    console.log(basicAuthHeader);
    // Output will be: { Authorization: 'Basic base64EncodedString' }

Generated using TypeDoc