In this last part, we will create an authenticated section of our app, where the user will be able to add and view support tickets. All the necessary requests are available on the server you already downloaded and if you are curious about how this has been done in the node with passport.js
, you can take a look at the sources!
In this first section, we will take care of the user system of our app. We will have both login and sign up components, to be able to create new users.
We will store the user data inside a state object like we did in Chapter 3, Project 2 - Castle Duel Browser Game, so we can access it in any component of the app:
- Create a new
state.js
file next tomain.js
, which exports the state object:
export default { user: null, }
The user
property will be null when no user is logged in, or else it will contain the user data.
- Then, in the
main.js
file, import the state:
import state from...