microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6a465861663d7c6f9433e89c6f6619df320dcef3

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

lib/app-center-node-client/src/appCenterClientCredentials.js

22lines · modepreview

//
// Custom credentials object for talking to AppCenter
//

class AppCenterClientCredentials {
  constructor(getToken) {
    this.getToken = getToken;
  }

  signRequest(request, callback) {
    this.getToken()
      .then(token => {
        request.headers["x-api-token"] = token;
        callback(null);
      })
      .catch((err) => {
        callback(err);
      });
  }
}

module.exports = AppCenterClientCredentials;