2020-02-18 08:57:00 +01:00
|
|
|
import { beforeRegisterGuard } from "@/router/guards/register-guard";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { Route, RouteConfig } from "vue-router";
|
2020-11-30 10:24:11 +01:00
|
|
|
import { EsModuleComponent } from "vue/types/options";
|
2019-01-29 11:02:32 +01:00
|
|
|
|
2019-02-22 14:55:47 +01:00
|
|
|
export enum UserRouteName {
|
2020-02-18 08:57:00 +01:00
|
|
|
REGISTER = "Register",
|
|
|
|
REGISTER_PROFILE = "RegisterProfile",
|
|
|
|
RESEND_CONFIRMATION = "ResendConfirmation",
|
|
|
|
SEND_PASSWORD_RESET = "SendPasswordReset",
|
|
|
|
PASSWORD_RESET = "PasswordReset",
|
2020-06-18 15:23:05 +02:00
|
|
|
EMAIL_VALIDATE = "EMAIL_VALIDATE",
|
2020-02-18 08:57:00 +01:00
|
|
|
VALIDATE = "Validate",
|
|
|
|
LOGIN = "Login",
|
2019-02-22 14:55:47 +01:00
|
|
|
}
|
|
|
|
|
2019-04-01 11:49:54 +02:00
|
|
|
export const userRoutes: RouteConfig[] = [
|
2019-02-22 11:24:41 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/register/user",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.REGISTER,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "RegisterUser" */ "@/views/User/Register.vue"
|
|
|
|
),
|
2019-02-22 11:24:41 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
2019-04-01 11:49:54 +02:00
|
|
|
beforeEnter: beforeRegisterGuard,
|
2019-02-22 11:24:41 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/register/profile",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.REGISTER_PROFILE,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "RegisterProfile" */ "@/views/Account/Register.vue"
|
|
|
|
),
|
2019-02-25 17:20:06 +01:00
|
|
|
// We can only pass string values through params, therefore
|
2020-11-27 19:27:44 +01:00
|
|
|
props: (route: Route): Record<string, unknown> => ({
|
2020-02-18 08:57:00 +01:00
|
|
|
email: route.params.email,
|
|
|
|
userAlreadyActivated: route.params.userAlreadyActivated === "true",
|
|
|
|
}),
|
2019-02-22 11:24:41 +01:00
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/resend-instructions",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.RESEND_CONFIRMATION,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "ResendConfirmation" */ "@/views/User/ResendConfirmation.vue"
|
|
|
|
),
|
2019-02-22 11:24:41 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/password-reset/send",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.SEND_PASSWORD_RESET,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "SendPasswordReset" */ "@/views/User/SendPasswordReset.vue"
|
|
|
|
),
|
2019-02-22 11:24:41 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/password-reset/:token",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.PASSWORD_RESET,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "PasswordReset" */ "@/views/User/PasswordReset.vue"
|
|
|
|
),
|
2019-02-22 11:24:41 +01:00
|
|
|
meta: { requiresAuth: false },
|
|
|
|
props: true,
|
|
|
|
},
|
2020-02-13 15:48:12 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/validate/email/:token",
|
2020-06-18 15:23:05 +02:00
|
|
|
name: UserRouteName.EMAIL_VALIDATE,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "EmailValidate" */ "@/views/User/EmailValidate.vue"
|
|
|
|
),
|
2020-02-13 15:48:12 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
2019-02-22 11:24:41 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/validate/:token",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.VALIDATE,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(/* webpackChunkName: "Validate" */ "@/views/User/Validate.vue"),
|
2019-02-25 17:20:06 +01:00
|
|
|
props: true,
|
2019-02-22 11:24:41 +01:00
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/login",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: UserRouteName.LOGIN,
|
2020-11-30 10:24:11 +01:00
|
|
|
component: (): Promise<EsModuleComponent> =>
|
|
|
|
import(/* webpackChunkName: "Login" */ "@/views/User/Login.vue"),
|
2019-02-22 11:24:41 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
];
|