Skip to content
No description, website, or topics provided.
Vue JavaScript HTML
Branch: master
Clone or download
Latest commit 2feac37 Nov 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public first Oct 29, 2019
src first Oct 29, 2019
.browserslistrc init Oct 22, 2019
.eslintrc.js
.gitignore
README.md
babel.config.js
package-lock.json first Oct 29, 2019
package.json
postcss.config.js

README.md

Vue Events App w/ Authentication

This is a simple Vue website that demonstrates how to get started with Vue.js, add authentication, and restrict certain pages from users who aren't logged in. You can clone this project and follow the directions below or check out the tutorial where I cover all the deets step by step!

Vue events app

Project setup

git clone https://github.com/hollylawly/vue-events-auth.git
npm install
npm run serve

View it in the browser at http://localhost:8080.

Adding Authentication to our Vue App

We're going to use Auth0 to add authentication to the app.

First, sign up for a free Auth0 account. Once you're registered, you'll be taken to the Auth0 management dashboard.

Click on the big red button that says "Create Application".

Name it "Vue Events" (or anything you'd like), click on "Single Page Web Applications" for "application type", and press "Create".

Auth0 Dashboard

Now click into "Settings" and fill in some information that Auth0 needs to configure authentication:

Allowed Callback URLshttp://localhost:8080 Allowed Logout URLshttp://localhost:8080 Allowed Web Originshttp://localhost:8080

That's all we need from the dashboard for now, but don't click out yet. We'll need to pull some of these values from the dashboard into our application soon.

Create a file (and add to .gitignore) for the config values:

touch auth_config.json

Now open up auth_config.json and paste in:

{
  "domain": "your-domain.auth0.com",
  "clientId": "yourclientid"
}

Finding your auth_config values:

  • Head to the Auth0 dashboard
  • Click on "Applications" and select your application
  • Click on "Settings"
  • Copy the value for "Domain" and paste it into domain in auth_config.json
  • Copy the value for "Client ID" and paste it into clientId in auth_config.json

Now you should be able to sign in to the application and access single event details.

You can’t perform that action at this time.