@atlassian/bitbucket-server
Version:
Bitbucket Server API client for Browser and Node.js
19 lines (15 loc) • 426 B
JavaScript
const authenticate = require('./authenticate')
const beforeRequest = require('./before-request')
class AuthenticationPlugin {
constructor(apiClient) {
this.core = apiClient
this.state = {
auth: false
}
}
inject() {
this.core.authenticate = authenticate.bind(null, this.state)
this.core.hook.before('request', beforeRequest.bind(null, this.state))
}
}
module.exports = AuthenticationPlugin