Giter VIP home page Giter VIP logo

vue-auth-gate's Introduction

Vue.js authentication gate

This repository contains Vue.js template acting like authentication gate for your system. It is based on several Vue dependencies listed below. Feel free to use and customise this template on your own.

❤️ Enjoy it !

Authentication logic

There isn't much of a nuclear science behind. Protected resources area accessed using JWT based accessToken. To get the token, perform Basic HTTP auth POST on /login. Then, use the token to access protected resources by glueing it to the URL itself.
More secure authentication methods are intentionally omitted to lower the complexity of this example. For your PRODUCTION needs - DON'T USE THIS APPROACH - and better come up with more secure solution (use OAuth or similar techniques).

Tech stack description

Template utilises following frameworks:

  • Vue - well you know it...
  • vue-router - for managing routes
  • Vuex - for state handling
  • axios - for customising HTTP requests
  • vee-validate - for form validation
  • bootstrap4 and other visual goodies (fontawesome etc...)
  • custom built HTTP companion server in Python (yeah ⭐️ would be nice !)
    • you can further customise 👆 server to serve your needs 😉

Rest of the template is good ol' JS in it's purest form.

Installation and setup

Before all, make sure you have Vue CLI installed.
Use -g option to install it into global package scope. Then:

$> npm install #wait for installation to complete

Companion server

For the template to work properly, it needs some sort of HTTP server processing the requests. I've used custom built HTTP server written in Python. Check out the repo here: https://github.com/vexy/flask-auth-template (oh dear it's vexy again 😑)

To run the server after installation and setup, just:
(make sure to checkout the docs for server installation and setup)

# run the server in this fancy way
$ . start.sh

If you're having problems with installation or setup, google the stuff first, then if you feel desperate - fire an issue here.

Running template locally

First, make sure your HTTP server is up and running. Then, run npm run serve.
(by default just point your browser to http://localhost:8000 or :8080)

Production ready build

To create production ready source, run npm run build. Optimised output will be stored in dist/ folder.

Inspiration

This example was inspired by: https://github.com/websanova/vue-auth


Copyright © 2020 Veljko Tekelerović
MIT Licence

vue-auth-gate's People

Contributors

dependabot[bot] avatar vexy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.