This package is using the packages
jsonwebtoken in order to provide some reusable functions for GraphQL authentication.
🙋♂️ Made by @thekitze
Make sure that your app has an
APP_SECRET env variable.
It includes the following functions:
getUserId(context): string- Returns the id from the currently logged-in user
getToken(userId: string): string- Returns a token by signing an object containing
getHashedPassword(password: string): string- Returns a hashed version of a password
comparePassword(password: string, comparePassword:string): boolean- Compares a password and a hashed password