Vue CLI 4 Plugin for adding Auth0 authentication.
MIT License
Vue CLI 4 Plugin for adding the files required for setting up Auth0 authentication.
Sign-up and login to you Auth0 Dashboard: https://auth0.com/
Create an Auth0 Client/Application: Dashboard > Applications > Create Application
Single Page Web Applications
Create
Settings
http://localhost:8080
to the following fields:
Save Changes
(Optional) Setup desired connections: Dashboard > Connections > Social
vue add auth0
from your project's root folder.auth_config.json
: Stores Auth0's domain and clientId.src/auth/index.js
: Main Auth0 lib file containing authentication logic.src/auth/authGuard.js
: Can be used to protect private vue-router routes.src/views/Profile.vue
: A very simple profile component to be used with vue-router.src/App.vue
src/main.js
src/router/index.js
Have you configured an Auth0 client? If not, make sure to update auth_config.json afterwards
Would you like to use Vue Router? This is the recomended setup for most Apps.
# Run a vue inside the dev container
docker run --rm -it \
-v "$(pwd)":/auth0 \
-p 8080:8080 \
kaizendorks/vue:4 sh
# Create sample app
vue create app
# Change dir to project dir
cd app
# Install plugin
npm install --save-dev file:/auth0
# Run plugin
vue invoke vue-cli-plugin-auth0
# Install new deps, if you get any errors try rm -rf package-lock.json
npm install
# Run app
npm run serve
# Build image
docker build -t auth0 .
# Dgoss Tests (quick smoke test to check if files were generated)
docker run --rm -it \
-v "$(pwd)/tests":/src \
-v /var/run/docker.sock:/var/run/docker.sock \
iorubs/dgoss run auth0
# Edit tests
docker run --rm -it \
-v "$(pwd)/tests":/src \
-v /var/run/docker.sock:/var/run/docker.sock \
iorubs/dgoss edit auth0
Goss is tool for validating server’s configuration (avoid conf. drift). Dgoss is a wrapper written on top of goss for validating docker images. https://github.com/aelsabbahy/goss/tree/master/extras/dgoss