- Page for user login (if the user is not authenticated)
- Sign up page to create a new user (if the user is not authenticated)
- Page with user information and logout button (if the user is already authenticated)
- Design UI for the
sign-inpage. - Create the
sign-uppage and design its interface. - Create logic to fetch and store a user in the browser's local storage. The structure of the stored object would be as follows:
account: {
name: String
email: String
password: String
}-
Create logic to fetch and store the login state in the browser's local storage. The structure of the stored object would be as follows:
-
Add functionality to add a user to the "Create" button of the form on the
sign-uppage, and store the active login state. -
Create logic to check if a user exists and if they are authenticated.
-
Restrict access to the
sign-inandsign-uppages for authenticated users. -
Correct link URL for "Sign in" in the
Navbar. -
Design the "Sign out" button in the
Navbar. -
Add sign-out functionality to the "Sign out" button in the
Navbar. -
Add sign-in functionality to the "Log in" button on the
sign-inpage. -
Restrict access to the
my-accountpage for logged-in users. -
Design UI for the
my-accountpage, which should display the "name" and "email" of the logged-in user. -
Add a route for editing user account details. It is recommended to reuse the interface from the
sign-uppage. -
Slightly change the interface of the
sign-uppage if the currently authenticated user is being edited. The user values should be displayed in the inputs, and the text of the "Create" button should be changed to "Edit".
The main navbar or menu of the application should change its structure depending on whether the user is authenticated or not:
- Show the user's email (if authenticated)
- Show the sign-in button (if not authenticated)
- Display the authenticated user's email in the
Navbar. - Show the "Sign out", "My Account", and "My Orders" links along with the "email" when a user is authenticated.
- Show the "Sign in" link when there is no authenticated user.
Checkout, Order History, and Product Viewing routes should not be visible to unauthenticated users:
- Redirect to the login page if the user is not authenticated
- Display the mentioned pages normally