Skip to content

Commit

Permalink
Get fresh auth token (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsh-coder authored Oct 4, 2022
1 parent 1204ba0 commit d96b2ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface HttpBinData {
console.log(JSON.stringify(secretsString));

var url = "https://prod.api.stepsecurity.io/v1/secrets";
const additionalHeaders = { Authorization: "Bearer " + authIDToken };
var additionalHeaders = { Authorization: "Bearer " + authIDToken };

var putResponse = await _http.putJson<HttpBinData>(
url,
Expand All @@ -50,6 +50,9 @@ interface HttpBinData {

while (true) {
try {
authIDToken = await core.getIDToken();
additionalHeaders = { Authorization: "Bearer " + authIDToken };

var response = await _http.get(url, additionalHeaders);
if (response.message.statusCode === 200) {
const body: string = await response.readBody();
Expand Down

0 comments on commit d96b2ef

Please sign in to comment.