Skip to content

Commit

Permalink
Adding casting
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Feb 5, 2018
1 parent 469e9b2 commit d04956c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ function buildHashString(type: "web" | "proxy", querystring: { [index: string]:
* @param convertToBase64 Whether the resulting hash should be converted to base64 or left as hex. Should be true for validating webhook requests.
*/
function getHmacHash(secretKey: string, hashString: string, convertToBase64 = false) {
let hash = crypto.HmacSHA256(hashString, secretKey);
/*
Casing to any since line 57 throws a type asignment error
`TS2322: Type 'string' is not assignable to type 'WordArray'.` if hash is allowed to be a wordArray
*/
let hash: any = crypto.HmacSHA256(hashString, secretKey)

if (convertToBase64) {
hash = crypto.enc.Base64.stringify(hash);
Expand Down

0 comments on commit d04956c

Please sign in to comment.