@tpp/um

User Management Helper

Usage no npm install needed!

<script type="module">
  import tppUm from 'https://cdn.skypack.dev/@tpp/um';
</script>

README

UM - User Management

This module helps handle user management (not for public release*)

icon

What it does

  1. Sign Up
    1. Id (Demo User)
    2. Name / Email / Password
      1. Optional Old Id
  2. Login
    1. Email / Password
    2. Id (Demo User)
  3. Change Password
    1. Old Password
    2. Token
  4. Verify Email
    1. Token
  5. Manage Profile
    1. Profile Picture
    2. Address
    3. Sex
    4. Goals
    5. Social Links
    6. Roles / Features

Technology

Uses JT

API

signup((badge, id) => ...);
signup({ name, email, password, id }, (badge, id) => ...)

login({ email, password }, (badge, id) => ...)
login({badge}, (refreshed, id) => ...)

check(badge, payload => ...)
decode(badge, payload => ...) // no verification

verifyemail({email, nonce}, token => ...)
verifyemail({email, nonce, token}, ok => ...)

changepw({email, old, new}, badge => ...)
changepw({email}, token => ...)
changepw({email, token, password}, badge => ...)

get({badge}, user => ...)
set({badge, info}, user => ...)

Shared Secret

Store the secret in a file and and provide it when starting up the user manager:

const um = require('um')(secretfile,...)

DB

Users are stored in a BabyDB which also should be provided on start up

const um = require('um')(secretfile, dbfile)

Errors

um.on('error', (err, rec) => ...)