express-user-authentication
v1.0.0
Published
A package you can use to create a user system with authentications
Downloads
2
Readme
Authentication Package
A package you can use to create a user system with authentications
Documentation
Setup
const expressAuthentication = require('express-user-authentication');
Create User
expressAuthentication.createUser({
username: "Dinoscape",
password: "MyPassword",
data: {
type: "User"
}
});
Edit User
expressAuthentication.editUser({
username: "Dinoscape",
password: "MyPassword",
options: {
username: "DinoRunner",
password: "SecurePassword",
data: {
type: "Admin"
}
}
});
Delete User
expressAuthentication.deleteUser({
username: "DinoRunner",
password: "SecurePassword"
});
Authentication
app.on("/admin", expressAuthentication({
data: {
type: "Admin"
}
}), (req, res) => {
res.send("You are an admin!");
})