Skip to content

Commit

Permalink
fix: makes utility to sign token public
Browse files Browse the repository at this point in the history
  • Loading branch information
Negan1911 committed Nov 29, 2021
1 parent 94434f2 commit cff1073
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ export class Firesquad {
/**
* This signs an authentication payload, used to validate your authentication
* with our API without transmitting your token, exchanging it to a short-timed JWT.
* If you're receiving websocket, use this to validate your `x-signature-sha-256` header against your secret.
* @param payload - payload to sign.
* @returns SHA-256 signature of the payload.
*/
private signPayload(payload: string) {
public signPayload(payload: string) {
return crypto
.createHmac('sha256', this.apiKey)
.update(payload)
Expand Down

0 comments on commit cff1073

Please sign in to comment.