vue-node-passport
vue-node-passport copied to clipboard
Example of implementing Twitch login via Passport in Vue.js
vue-node-passport
Description
This is a small example of using an openID provider to add authentication to your applications. I had a ton of trouble understanding the Passport workflow so hopefully this helps.
Try it out here!
It's using Passport, and it's implemented on the frontend using Vue.js, but any framework would work - accessing a single api point is all that needs to be done to check user logged-in status and retrieve data.
Setup
- Start with the obvious:
npm install
- Rename
server/settings.js.exampletoserver/settings.jsand fill in all of your information for Mongo, Twitch, etc.
Running the Server
For this project, you'll be running two servers: a Node server for the backend, and vue-cli-service for hot-reloading and building your app. Run each of the following commands in two different terminals:
node server.js
npm run serve
The example app is now up and running. You should be able to login with your Twitch account.
What if I want to login with [a different service]?
You'll need to change the Passport strategy. Just about every service already has a passport strategy available. You'll need to update server.js but that's about it.
I have more questions!
I'd love to help - UPDATE: I don't have social media anymore, so just leave an issue here on Github.