lk-users-convexpress
Convexpress routes to implement a user system in the lk-architecture.
Usage
Example usage with mongodb as database.
;;;;; const dispatchEvent = ; const usersOptions = jwtSecret: "jwtSecret" jwtIssuer: "jwtIssuer" dispatchEvent: dispatchEvent findUserByEmail: async { const db = await mongodb; return db; } findUserById: async { const db = await mongodb; return db; } user_id allowSignup: false;const usersConvroutes = ;const authenticate = ; const convrouter = ; ;
API
getConvroutes(options)
=> returns an object with all defined convroutesgetAuthenticateMiddleware(options)
=> returns a middleware function to authenticate requests
options
jwtSecret
jwtIssuer
dispatchEvent
findUserByEmail
findUserById
getUserId
allowSignup
(optional)