UNPKG

authenzify

Version:

server to manage authentication authorization of users and more

16 lines (14 loc) 369 B
import jsonwebtokenPkg from 'jsonwebtoken' const { verify } = jsonwebtokenPkg export const initVerifyToken = ({ publicKey, jwtOptions }) => { const jwtVerifyOptions = { ...jwtOptions, algorithm: [jwtOptions.algorithm], } return { verifyToken(token) { const decoded = verify(token, publicKey, jwtVerifyOptions) return decoded }, } }