Skip to content

gedrick/vue-node-passport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Start with the obvious:
npm install
  1. Rename server/settings.js.example to server/settings.js and 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.

About

Example of implementing Twitch login via Passport in Vue.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published