edited some texts
This commit was merged in pull request #2.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
"use client"
|
||||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
/**
|
||||
* This is used to protect routes in a web application.
|
||||
* This function is used to protect routes in a web application.
|
||||
* It checks if the user is authenticated and redirects them to the sign-in page if they are not.
|
||||
|
||||
*/
|
||||
const AuthRoute = ({ children }) => {
|
||||
const router = useRouter();
|
||||
@@ -14,7 +15,7 @@ const AuthRoute = ({ children }) => {
|
||||
|
||||
if (!isAuthenticated) {
|
||||
router.push("/authentication/sign-in/");
|
||||
}
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return <>{children}</>;
|
||||
|
||||
Reference in New Issue
Block a user