codyseibert / tab-tracker

A Vue.js / Express.js web application for keeping track of guitar tabs
MIT License
520 stars 197 forks source link

[Question] Why do we need an AuthenticationService? #30

Open areebbeigh opened 5 years ago

areebbeigh commented 5 years ago

I'm just starting out with this tutorial series and I'm confused about why we need to use an AuthenticationService to register / login users? Can't we simply have a register/login form on the front end that submits to the express server through POST?

s-gryt commented 5 years ago

Verifying tokens in HTTP headers is one of the best authentication practices in single page applications. Register/login actually submits POST method to a server and Vue+Vuex is storing the token in a browser's local storage.