0.0.24 • Published 4 years ago

@nodeauth/auth-pg v0.0.24

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Auth-PG

Installation

npm install --save @nodeauth/auth-pg pg

Setup

const authPG = require("@nodeauth/auth-pg");
const pg = require("pg");
const client = new pg.Client(pgConfig);
authPG.create({ pgClient: client });
client.connect();

Exposes

authPG in const authPG = require('@nodeauth/auth-pg') exposes two objects that give you a lot of power when it comes to authentication and users. authPG.auth.users and authPG.auth.token.

authPG.auth.users

  • createUserVerificationAndPassword - (email, password) can include all other user info as well. (phone, email, username, first_name, ...)
    • returns {verification, user, token}, does not return password
  • verifyUser - (verification_code)
    • returns an {Object} -> {email, verified}
  • forgotPassword - (email)
    • return an {Object} -> {email, password, expiresIn}
  • resetPasswordFromTemporaryPassword - (email, tempPassword, newPassword)
    • returns {boolen} true or false
  • getUser - (email)
    • returns the full user object
  • updateUser - (email) and anything else, except for password
    • returns all data sent as parameter

authPG.auth.token

  • generateToken
  • authenticateToken
  • login
0.0.23

4 years ago

0.0.24

4 years ago

0.0.22

4 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.19

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago