Code Monkey home page Code Monkey logo

express-vhosts-sessions's Introduction

Example Express.js + Vhost + Passport.js sessions

Book session on Codementor        BitCoin donate button Donate with Gratipay

The problem

Passport.js happens to share strategy between different vhosts.

Local users

Alice is an Artist
She visits artist_app at artist.aa

Bob is a Baker
He visits baker_app at baker.aa

They don't know about each other. But Alice finds herself logged in as Bob (a user from a site she is not even aware of).

Solution: use Passports.js to manage instances of Passport.js

Setup

npm install

define local hosts:
artist.aa
baker.aa

Run node server

Open artist.aa:9090 and baker.aa:9090

Apps

While the contents of artist_app and baker_app is identical in this example, it doesn't have to be in the real world. They are completely independend of each other.

express-vhosts-sessions's People

Contributors

yuraji avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.