mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-07 10:33:18 +08:00
added dist folder
This commit is contained in:
@@ -16,13 +16,12 @@ export async function getIDToken(audience: string): Promise<string> {
|
||||
if (id_token !== undefined) {
|
||||
const secondsSinceEpoch = Math.round(Date.now() / 1000)
|
||||
const id_token_json: any = jwt_decode(id_token)
|
||||
if('exp' in id_token_json) {
|
||||
if ('exp' in id_token_json) {
|
||||
if (id_token_json['exp'] - secondsSinceEpoch > 300) {
|
||||
// Expiry time is more than 5 mins
|
||||
return id_token
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new Error('Expiry time not defined in ID Token')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user