https://github.com/ecomplus/passport
E-Com Plus service for customer login and signup with Passportjs
https://github.com/ecomplus/passport
Last synced: 3 months ago
JSON representation
E-Com Plus service for customer login and signup with Passportjs
- Host: GitHub
- URL: https://github.com/ecomplus/passport
- Owner: ecomplus
- License: gpl-3.0
- Created: 2018-01-09T17:21:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-31T05:06:39.000Z (4 months ago)
- Last Synced: 2025-01-31T06:18:34.235Z (4 months ago)
- Language: JavaScript
- Size: 753 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ecomplus-passport
E-Com Plus service for customer login and signup with Passportjs# Technology stack
+ [NodeJS](https://nodejs.org/en/) 12+
+ [Express](http://expressjs.com/) web framework package
+ [Passport](http://www.passportjs.org/) package
+ OAuth strategies: Facebook, Google, Twitter, Instagram, Yahoo and Windows Live
+ [JSON Web Token](https://jwt.io/)# Setting up
```bash
git clone https://github.com/ecomplus/passport
cd ecomplus-passport
cp config/config-sample.json config/config.json
nano config/config.json
```Edit `config.json` placing correct values for your environment,
after that, start app with node:```bash
node ./main.js
```# Web server
You need to use a web server such as NGINX or Apache HTTP,
proxy passing the requests to configured TCP port.# Frontend script
## Example
```javascript
var uri = 'https://passport.e-com.plus/v1/pt_br/1004/sdjcksadcasbcsabdcbsldjlbcasbdcs/login.html'
var popup = window.open(uri, 'Passport', 'height=400,width=340')
if (window.focus) {
popup.focus()
}
var getCustomerInfo = function () {
// run after login
clearInterval(popupWatch)
console.log('logged?')
}
// public callback function
window.passportCallback = function () {
// logged
getCustomerInfo()
}
// fallback
var popupWatch = setInterval(function () {
if (popup.closed) {
// may be logged
getCustomerInfo()
}
}, 400)
```