0.0.24 • Published 3 years ago

@nodeauth/auth-pg v0.0.24

Weekly downloads
-
License
ISC
Repository
-
Last release
3 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

3 years ago

0.0.24

3 years ago

0.0.22

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.19

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago