https://github.com/devdhera/express-ideamart
https://github.com/devdhera/express-ideamart
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/devdhera/express-ideamart
- Owner: DevDHera
- License: mit
- Created: 2018-04-08T06:50:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-09T15:02:34.000Z (over 7 years ago)
- Last Synced: 2025-02-06T04:43:55.988Z (over 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Express-IdeaMart
Fully Node and Express based IdeaMart for publish new inovative ideas.
Passport is used to ensure authentication.
## Technologies Used
* Node.js
* Express.js
* Passport.js
* Handlebars
* Flash messaging
* MLab NoSQL Database
## Steps to Run
Project consists of local DB constraints. To run the project on local machine follow the steps shown below.
1. Install the modules.
```bash
npm install
```
2. Simply run the app using following.
```bash
npm start
```
## Authentication
Project uses Passport local strategies to authenticate users.
```javascript
module.exports = function(passport){
passport.use(new LocalStrategy({usernameField: 'email'}, (email, password, done) => {
//Match User
User.findOne({
email: email
}).then(user => {
if(!user){
return done(null, false, {message: 'No User Found'});
}
//Match Password
bcrypt.compare(password, user.password, (err, isMatch) => {
if(err) throw err;
if(isMatch){
return done(null, user);
}else{
return done(null, false, {message: 'Password Incorrect'});
}
})
})
}));
```
## Task to achive
* [x] User Authentication
* [ ] Google Auth
* [ ] Facebook Auth