http-auth-client
Version:
Client side HTTP Authorization header handling
24 lines (19 loc) • 364 B
JavaScript
class Bearer {
constructor(params) {
// Nothing
}
credentials(token) {
this.token = token
return this
}
authorization() {
return this.type + " " + this.token
}
update(params) {
// Always needs new credentials
// But we don't delete the token
return true
}
}
Bearer.prototype.type = "Bearer"
module.exports = Bearer