mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: not found AppRouterInstance type
This commit is contained in:
parent
8e9aac9bc3
commit
93def5a59e
2 changed files with 5 additions and 5 deletions
|
|
@ -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";
|
import { NextRouter } from "next/router";
|
||||||
|
|
||||||
export const denyAccessToUser = (error : any, router: AppRouterInstance) => {
|
export const denyAccessToUser = (error: any, router: AppRouterInstance) => {
|
||||||
if (error.status === 401) {
|
if (error.status === 401) {
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}
|
}
|
||||||
|
|
@ -10,5 +10,4 @@ export const denyAccessToUser = (error : any, router: AppRouterInstance) => {
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
// TODO : add a message to the user to tell him he is not allowed to access this page, route to /error
|
// TODO : add a message to the user to tell him he is not allowed to access this page, route to /error
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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 { denyAccessToUser } from "../react/middlewares/views";
|
||||||
import { getUriWithOrg, LEARNHOUSE_DOMAIN, LEARNHOUSE_HTTP_PROTOCOL } from "@services/config/config";
|
import { getUriWithOrg, LEARNHOUSE_DOMAIN, LEARNHOUSE_HTTP_PROTOCOL } from "@services/config/config";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue