https://github.com/dinoscapeprogramming/authentication-package
A package you can use to create a user system with authentications
https://github.com/dinoscapeprogramming/authentication-package
Last synced: 8 months ago
JSON representation
A package you can use to create a user system with authentications
- Host: GitHub
- URL: https://github.com/dinoscapeprogramming/authentication-package
- Owner: DinoscapeProgramming
- License: apache-2.0
- Created: 2022-09-11T17:09:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-16T15:58:23.000Z (almost 4 years ago)
- Last Synced: 2025-06-08T21:33:15.337Z (about 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Authentication Package
A package you can use to create a user system with authentications
## Documentation
### Setup
```js
const expressAuthentication = require('express-user-authentication');
```
### Create User
```js
expressAuthentication.createUser({
username: "Dinoscape",
password: "MyPassword",
data: {
type: "User"
}
});
```
### Edit User
```js
expressAuthentication.editUser({
username: "Dinoscape",
password: "MyPassword",
options: {
username: "DinoRunner",
password: "SecurePassword",
data: {
type: "Admin"
}
}
});
```
### Delete User
```js
expressAuthentication.deleteUser({
username: "DinoRunner",
password: "SecurePassword"
});
```
### Authentication
```js
app.on("/admin", expressAuthentication({
data: {
type: "Admin"
}
}), (req, res) => {
res.send("You are an admin!");
})
```