@fanoutio/grip
Version:
GRIP Interface Library
16 lines (15 loc) • 425 B
JavaScript
// Bearer authentication class used for building auth headers containing a literal token.
export class Bearer {
_token;
constructor(token) {
// Initialize with the specified literal token.
this._token = token;
}
getToken() {
return this._token;
}
// Returns the auth header containing the Bearer token.
async buildHeader() {
return `Bearer ${this._token}`;
}
}