- The first profile is now created after the user email validation - NavBar is correctly updated when a user is connected but without any profile - Always fetch identities from the server at login (no cache) - NoIdentitiesException is thrown again - Refactor EditIdentity to create the first profile - Translations updated - Tests updated Fixes #1762
122 lines
3.3 KiB
TypeScript
122 lines
3.3 KiB
TypeScript
import { beforeRegisterGuard } from "@/router/guards/register-guard";
|
|
import { RouteRecordRaw } from "vue-router";
|
|
import { i18n } from "@/utils/i18n";
|
|
|
|
const t = i18n.global.t;
|
|
|
|
export enum UserRouteName {
|
|
REGISTER = "Register",
|
|
RESEND_CONFIRMATION = "ResendConfirmation",
|
|
SEND_PASSWORD_RESET = "SendPasswordReset",
|
|
PASSWORD_RESET = "PasswordReset",
|
|
EMAIL_VALIDATE = "EMAIL_VALIDATE",
|
|
VALIDATE = "Validate",
|
|
LOGIN = "Login",
|
|
OAUTH_AUTORIZE = "OAUTH_AUTORIZE",
|
|
OAUTH_LOGIN_DEVICE = "OAUTH_LOGIN_DEVICE",
|
|
}
|
|
|
|
export const userRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: "/register/user",
|
|
name: UserRouteName.REGISTER,
|
|
component: (): Promise<any> => import("@/views/User/RegisterView.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiredAuth: false,
|
|
announcer: { message: (): string => t("Register") as string },
|
|
},
|
|
beforeEnter: beforeRegisterGuard,
|
|
},
|
|
{
|
|
path: "/resend-instructions/:email?",
|
|
name: UserRouteName.RESEND_CONFIRMATION,
|
|
component: (): Promise<any> =>
|
|
import("@/views/User/ResendConfirmation.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiresAuth: false,
|
|
announcer: {
|
|
message: (): string => t("Resent confirmation email") as string,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: "/password-reset/send/:email?",
|
|
name: UserRouteName.SEND_PASSWORD_RESET,
|
|
component: (): Promise<any> => import("@/views/User/SendPasswordReset.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiresAuth: false,
|
|
announcer: {
|
|
message: (): string => t("Send password reset") as string,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: "/password-reset/:token",
|
|
name: UserRouteName.PASSWORD_RESET,
|
|
component: (): Promise<any> => import("@/views/User/PasswordReset.vue"),
|
|
meta: {
|
|
requiresAuth: false,
|
|
announcer: { message: (): string => t("Password reset") as string },
|
|
},
|
|
props: true,
|
|
},
|
|
{
|
|
path: "/validate/email/:token",
|
|
name: UserRouteName.EMAIL_VALIDATE,
|
|
component: (): Promise<any> => import("@/views/User/EmailValidate.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiresAuth: false,
|
|
announcer: { message: (): string => t("Email validate") as string },
|
|
},
|
|
},
|
|
{
|
|
path: "/validate/:token",
|
|
name: UserRouteName.VALIDATE,
|
|
component: (): Promise<any> => import("@/views/User/ValidateUser.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiresAuth: false,
|
|
announcer: {
|
|
message: (): string => t("Validating account") as string,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: "/login",
|
|
name: UserRouteName.LOGIN,
|
|
component: (): Promise<any> => import("@/views/User/LoginView.vue"),
|
|
props: true,
|
|
meta: {
|
|
requiredAuth: false,
|
|
announcer: { message: (): string => t("Login") as string },
|
|
},
|
|
},
|
|
{
|
|
path: "/oauth/autorize_approve",
|
|
name: UserRouteName.OAUTH_AUTORIZE,
|
|
component: (): Promise<any> => import("@/views/OAuth/AuthorizeView.vue"),
|
|
meta: {
|
|
requiredAuth: true,
|
|
announcer: {
|
|
message: (): string => t("Authorize application") as string,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: "/login/device",
|
|
name: UserRouteName.OAUTH_LOGIN_DEVICE,
|
|
component: (): Promise<any> =>
|
|
import("@/views/OAuth/DeviceActivationView.vue"),
|
|
meta: {
|
|
requiredAuth: true,
|
|
announcer: {
|
|
message: (): string => t("Device activation") as string,
|
|
},
|
|
},
|
|
},
|
|
];
|