mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Use the enum for error route
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a40d202dd7
commit
cb00f6f6b0
1 changed files with 2 additions and 1 deletions
|
@ -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 },
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue