microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
326e032d29394b48bb49c3013f46b0f4c14c26f7

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 · modecode

1//
2// Custom credentials object for talking to AppCenter
3//
4
5class AppCenterClientCredentials {
6 constructor(getToken) {
7 this.getToken = getToken;
8 }
9
10 signRequest(request, callback) {
11 this.getToken()
12 .then(token => {
13 request.headers["x-api-token"] = token;
14 callback(null);
15 })
16 .catch((err) => {
17 callback(err);
18 });
19 }
20}
21
22module.exports = AppCenterClientCredentials;