UNPKG

phantomauth

Version:

An authentication library with built-in security features, designed for fast and boilerplate-free backend development. Ideal for quickly building MVPs with a reasonable level of security. Not intended for high-risk or enterprise level use.

10 lines (9 loc) 238 B
import jwt from 'jsonwebtoken'; export const createJwt = (userId, email) => { const token = jwt.sign( { userId, email }, process.env.JWT_SECRET, { expiresIn: `${process.env.JWT_LIFESPAN}` } ); return token; }