Authful
A lightweight authentication library for Node
Summary
I find myself continously going through the process of implementing authentication for my projects and they only require a basic system to get started. This is a slightly higher level library that wraps jsonwebtoken and bcrypt and provides common methods.
✨ 1.3kB minified + gzip
Installation
npm install authful -s
const authful = secret: 'ffj3493$R#J@$f#$Jo3ofk' expiresIn: '1h' // default: 24hr
Usage
#️⃣ Hash a password
const hash = await authfulpwdhash plaintext
:check: Check a password
const match = await authfulpwd
🔒 Create a token
const token = await authfultoken
🔐 Decode a token
const payload = await authfultoken
🔄 Refresh a token
const token2 = await authfultoken