planettelex / Songtracker-Pro

Music Income Tracking for Record Labels, Publishers, and Artists
MIT License
3 stars 0 forks source link

Connect Vue App To API and Call /login After Successful Authentication #28

Closed RobDixonIII closed 3 years ago

RobDixonIII commented 3 years ago

Use https://github.com/Amareis/another-rest-client https://robsontenorio.github.io/vue-api-query/ to make API calls.

The first API call will be to /login upon successful authentication. Take the results of that call and store them in state. On every page other than /login and /accept-invitation, if User or Login is null or either of the Login properties are null, logout and redirect to /login.

RobDixonIII commented 3 years ago

Also save the token expiration indicated by the timestamp expires_at, and have the API also respect that expiration.

RobDixonIII commented 3 years ago

Some good practices when incorporating the API and state: https://www.telerik.com/blogs/10-good-practices-building-maintaining-large-vuejs-projects