Our Admin Hompage should be this: admin/home.vue 👇 We need it because there are some functions/api routes that we don’t want to be available to the public.
The respective route in api.php should be: Now that we have a login component, we need to create a user.
The code for reload+redirecting the site and going to admin route is window.location.href = "/admin"; This works but it is not efficient.
Our login method should be this: Now, the navigation guard will look at window.AuthCheck and find that it‘s value is 1 and let the authenticated user go to the admin path.