import { createRouter, createWebHistory } from "vue-router";
const homeView = () => import("@/views/home.vue");
const ssoPage = () => import("@/views/sso.vue");

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home-page",
      component: homeView,
      children: [
        /**
         * 404 Not Found
         * ref: https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route
         */
        {
          path: "/:pathMatch(.*)*",
          name: "NotFound",
          component: () => import("@/views/ErrorNotFoundPage.vue"),
          meta: {
            Auth: true,
          },
        },
      ],
    },
    {
      path: "/sso",
      name: "sso-page",
      component: ssoPage,
      meta: {
        Auth: false,
      },
    },
  ],
});

export default router;
