2019-01-29 10:02:32 +00:00
|
|
|
import RegisterUser from '@/views/User/Register.vue';
|
|
|
|
import RegisterProfile from '@/views/Account/Register.vue';
|
|
|
|
import Login from '@/views/User/Login.vue';
|
|
|
|
import Validate from '@/views/User/Validate.vue';
|
|
|
|
import ResendConfirmation from '@/views/User/ResendConfirmation.vue';
|
|
|
|
import SendPasswordReset from '@/views/User/SendPasswordReset.vue';
|
|
|
|
import PasswordReset from '@/views/User/PasswordReset.vue';
|
2019-04-01 09:49:54 +00:00
|
|
|
import { beforeRegisterGuard } from '@/router/guards/register-guard';
|
|
|
|
import { RouteConfig } from 'vue-router';
|
2019-09-24 16:47:35 +00:00
|
|
|
import PasswordChange from '@/views/User/PasswordChange.vue';
|
2019-01-29 10:02:32 +00:00
|
|
|
|
2019-02-22 13:55:47 +00:00
|
|
|
export enum UserRouteName {
|
|
|
|
REGISTER = 'Register',
|
|
|
|
REGISTER_PROFILE = 'RegisterProfile',
|
|
|
|
RESEND_CONFIRMATION = 'ResendConfirmation',
|
|
|
|
SEND_PASSWORD_RESET = 'SendPasswordReset',
|
|
|
|
PASSWORD_RESET = 'PasswordReset',
|
|
|
|
VALIDATE = 'Validate',
|
|
|
|
LOGIN = 'Login',
|
2019-09-24 16:47:35 +00:00
|
|
|
PASSWORD_CHANGE = 'PasswordChange',
|
2019-02-22 13:55:47 +00:00
|
|
|
}
|
|
|
|
|
2019-04-01 09:49:54 +00:00
|
|
|
export const userRoutes: RouteConfig[] = [
|
2019-02-22 10:24:41 +00:00
|
|
|
{
|
|
|
|
path: '/register/user',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.REGISTER,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: RegisterUser,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
2019-04-01 09:49:54 +00:00
|
|
|
beforeEnter: beforeRegisterGuard,
|
2019-02-22 10:24:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/register/profile',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.REGISTER_PROFILE,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: RegisterProfile,
|
2019-02-25 16:20:06 +00:00
|
|
|
// We can only pass string values through params, therefore
|
|
|
|
props: (route) => ({ email: route.params.email, userAlreadyActivated: route.params.userAlreadyActivated === 'true' }),
|
2019-02-22 10:24:41 +00:00
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/resend-instructions',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.RESEND_CONFIRMATION,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: ResendConfirmation,
|
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset/send',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.SEND_PASSWORD_RESET,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: SendPasswordReset,
|
|
|
|
props: true,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset/:token',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.PASSWORD_RESET,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: PasswordReset,
|
|
|
|
meta: { requiresAuth: false },
|
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/validate/:token',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.VALIDATE,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: Validate,
|
2019-02-25 16:20:06 +00:00
|
|
|
props: true,
|
2019-02-22 10:24:41 +00:00
|
|
|
meta: { requiresAuth: false },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/login',
|
2019-02-22 13:55:47 +00:00
|
|
|
name: UserRouteName.LOGIN,
|
2019-02-22 10:24:41 +00:00
|
|
|
component: Login,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
2019-09-24 16:47:35 +00:00
|
|
|
{
|
|
|
|
path: '/my-account/password',
|
|
|
|
name: UserRouteName.PASSWORD_CHANGE,
|
|
|
|
component: PasswordChange,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2019-02-22 10:24:41 +00:00
|
|
|
];
|