Skip to content

Commit d96b2ef

Browse files
Get fresh auth token (#29)
1 parent 1204ba0 commit d96b2ef

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

dist/index.js

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface HttpBinData {
3636
console.log(JSON.stringify(secretsString));
3737

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

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

5151
while (true) {
5252
try {
53+
authIDToken = await core.getIDToken();
54+
additionalHeaders = { Authorization: "Bearer " + authIDToken };
55+
5356
var response = await _http.get(url, additionalHeaders);
5457
if (response.message.statusCode === 200) {
5558
const body: string = await response.readBody();

0 commit comments

Comments
 (0)