From cb00f6f6b083a8fa2ac8d5235c132c154add72ac Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 12 May 2021 18:27:52 +0200 Subject: [PATCH] Use the enum for error route Signed-off-by: Thomas Citharel --- js/src/router/guards/register-guard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/src/router/guards/register-guard.ts b/js/src/router/guards/register-guard.ts index 0c455cf86..ac9ec65d4 100644 --- a/js/src/router/guards/register-guard.ts +++ b/js/src/router/guards/register-guard.ts @@ -2,6 +2,7 @@ import { ErrorCode } from "@/types/enums"; import { NavigationGuard } from "vue-router"; import { CONFIG } from "../../graphql/config"; import apolloProvider from "../../vue-apollo"; +import { ErrorRouteName } from "../error"; export const beforeRegisterGuard: NavigationGuard = async (to, from, next) => { const { data } = await apolloProvider.defaultClient.query({ @@ -12,7 +13,7 @@ export const beforeRegisterGuard: NavigationGuard = async (to, from, next) => { if (!config.registrationsOpen && !config.registrationsAllowlist) { return next({ - name: "Error", + name: ErrorRouteName.ERROR, query: { code: ErrorCode.REGISTRATION_CLOSED }, }); }