From 93def5a59ee68b9d1e34d6e8d1f562edd5e867f6 Mon Sep 17 00:00:00 2001 From: swve Date: Tue, 19 Sep 2023 20:03:08 +0200 Subject: [PATCH] fix: not found AppRouterInstance type --- front/services/utils/react/middlewares/views.ts | 7 +++---- front/services/utils/ts/requests.ts | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/front/services/utils/react/middlewares/views.ts b/front/services/utils/react/middlewares/views.ts index 6ab82348..24692d01 100644 --- a/front/services/utils/react/middlewares/views.ts +++ b/front/services/utils/react/middlewares/views.ts @@ -1,7 +1,7 @@ -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context"; +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { NextRouter } from "next/router"; -export const denyAccessToUser = (error : any, router: AppRouterInstance) => { +export const denyAccessToUser = (error: any, router: AppRouterInstance) => { if (error.status === 401) { router.push("/login"); } @@ -10,5 +10,4 @@ export const denyAccessToUser = (error : any, router: AppRouterInstance) => { router.push("/login"); // TODO : add a message to the user to tell him he is not allowed to access this page, route to /error } - -} \ No newline at end of file +}; diff --git a/front/services/utils/ts/requests.ts b/front/services/utils/ts/requests.ts index fc4e66c7..367b69c1 100644 --- a/front/services/utils/ts/requests.ts +++ b/front/services/utils/ts/requests.ts @@ -1,4 +1,5 @@ -import { AppRouterInstance } from "next/dist/shared/lib/app-router-context"; + +import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime"; import { denyAccessToUser } from "../react/middlewares/views"; import { getUriWithOrg, LEARNHOUSE_DOMAIN, LEARNHOUSE_HTTP_PROTOCOL } from "@services/config/config";