Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Use string for userId in TWT
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Aug 18, 2020
1 parent 79b52bc commit 661bf6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_staart/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ApiKeyResponse } from "./jwt";
*/
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

export const twtToId = (twt: string, userId?: number) =>
export const twtToId = (twt: string, userId?: string) =>
twt === "me" && userId
? userId
? parseInt(verify(userId, config("twtSecret"), 10), 10)
: parseInt(verify(twt, config("twtSecret"), 10), 10);

/**
Expand Down

0 comments on commit 661bf6d

Please sign in to comment.