1.0.2 • Published 5 years ago

authful v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

npm.io

Authful

MIT License npm version dependencies

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.

:sparkles: 1.3kB minified + gzip

Installation

npm install authful -s
import * as Authful from 'authful'

const authful = new Authful({
  secret: 'ffj3493$R#J@$f#$Jo3ofk',
  expiresIn: '1h' // default: 24hr
})

Usage

docs in progress

:hash: Hash a password

const hash = await authful.pwd.hash({ plaintext })

:check: Check a password

const match = await authful.pwd.check({ hash, plaintext })

:lock: Create a token

const token = await authful.token.create(payload)

:closed_lock_with_key: Decode a token

const payload = await authful.token.decode(token)

:arrows_counterclockwise: Refresh a token

const token2 = await authful.token.refresh(token)
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago