https://github.com/terrymooreii/hapi-jwt-mongo
Hapi Authentication with JWT with Mongo. Example/Starter project
https://github.com/terrymooreii/hapi-jwt-mongo
Last synced: about 1 month ago
JSON representation
Hapi Authentication with JWT with Mongo. Example/Starter project
- Host: GitHub
- URL: https://github.com/terrymooreii/hapi-jwt-mongo
- Owner: TerryMooreII
- License: mit
- Created: 2017-03-16T23:07:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-16T23:11:09.000Z (about 9 years ago)
- Last Synced: 2025-11-07T22:25:02.964Z (7 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hapi Authentication and Authorization with JWT and mongo
==========
Example to show how authentication and authorization works in Hapi.js on Node.js with Mongo/Mlab and JWT.
This project was cloned from a hapi with cookie auth [example.](https://medium.com/@poeticninja/authentication-and-authorization-with-hapi-5529b5ecc8ec#.12z6lpcao) So props...
hapi JWT is from [here](https://github.com/dwyl/hapi-auth-jwt2)
Config.js
-----------
Add a config.js to the root of your project (Better yet update to use ENV params)
```javascrpt
module.exports = {
token:{
secret: 'output of this ->' //node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
},
db: {
username: '',
password: '',
hostname: '',
database: '',
port: ''
},
server: {
hostname: 'localhost',
port: 3000
}
}
```