0.0.24 • Published 4 years ago
@nodeauth/auth-pg v0.0.24
Auth-PG
Installation
npm install --save @nodeauth/auth-pg pgSetup
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
5 years ago
0.0.16
5 years ago
0.0.17
5 years ago
0.0.18
5 years ago
0.0.10
5 years ago
0.0.11
5 years ago
0.0.12
5 years ago
0.0.13
5 years ago
0.0.14
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago