All files / lib/auth token.js

20% Statements 1/5
0% Branches 0/3
0% Functions 0/2
20% Lines 1/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                        3x      
class TokenAuthentication {
  constructor (options = {}) {
    this.token = options.token
    this.scheme = options.scheme || 'Bearer'
  }
 
  authenticate (options) {
    options.headers['Authorization'] = this.scheme + ' ' + this.token
    return options
  }
}
 
module.exports = {
  TokenAuthentication: TokenAuthentication
}