dev: route validation on non authenticated pages (#1238)

This commit is contained in:
guru_sainath 2023-06-07 13:47:56 +05:30 committed by GitHub
parent f9cd1b1352
commit 3d5fcbd4ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 21 deletions

View file

@ -5,7 +5,7 @@ import useSWR from "swr";
// components
import ToastAlert from "components/toast-alert";
// hooks
import useUser from "hooks/use-user";
import useUserAuth from "hooks/use-user-auth";
// services
import projectService from "services/project.service";
// fetch-keys
@ -65,7 +65,7 @@ export const reducer: ReducerFunctionType = (state, action) => {
export const ThemeContextProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const [state, dispatch] = useReducer(reducer, initialState);
const { user } = useUser();
const { user } = useUserAuth(null);
const router = useRouter();
const { workspaceSlug, projectId } = router.query;