Skip to content

Commit

Permalink
SK-1454 fix to reject invalid credentials json
Browse files Browse the repository at this point in the history
  • Loading branch information
skyflow-srivyshnavi committed Feb 9, 2024
1 parent aec64d4 commit 8e4454a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service-account/util/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function getToken(credentials, options?: BearerTokenOptions): Promise<ResponseTo
}
catch (e) {
printLog(errorMessages.NotAValidJSON, MessageType.ERROR);
throw new SkyflowError({ code: 400, description: errorMessages.NotAValidJSON });
reject(new SkyflowError({ code: 400, description: errorMessages.NotAValidJSON }));
}
const expiryTime = Math.floor(Date.now() / 1000) + 3600;

Expand Down Expand Up @@ -296,7 +296,7 @@ function getSignedTokens(credentials, options: SignedDataTokensOptions): Promise
}
catch (e) {
printLog(errorMessages.NotAValidJSON, MessageType.ERROR);
throw new SkyflowError({ code: 400, description: errorMessages.NotAValidJSON });
reject(new SkyflowError({ code: 400, description: errorMessages.NotAValidJSON }));
}

let expiryTime;
Expand Down

0 comments on commit 8e4454a

Please sign in to comment.