UNPKG

agora-rest-client

Version:
19 lines (18 loc) 563 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BasicCredential = void 0; const utils_1 = require("../utils"); class BasicCredential { constructor(username, password) { this.username = username; this.password = password; } getName() { return 'basic_auth'; } setAuth(headers) { const base64Credentials = (0, utils_1.base64)(`${this.username}:${this.password}`); headers.authorization = `Basic ${base64Credentials}`; } } exports.BasicCredential = BasicCredential;