-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: custom post loading and add AppAuthenticatedPage (#3632)
* Added post loading hook to appInitPage * Removed custom post loading * Changed custom post loading to cusotm post auth * Adds AppAuthenticatedPage * Uses AppAuthenticatedPage inside protected route
- Loading branch information
1 parent
387ea32
commit 3bef9aa
Showing
3 changed files
with
107 additions
and
72 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/frontend/src/customization/hooks/use-custom-post-auth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { UseRequestProcessor } from "@/controllers/API/services/request-processor"; | ||
import { useQueryFunctionType } from "@/types/api"; | ||
|
||
export const useCustomPostAuth: useQueryFunctionType<undefined, null> = ( | ||
options, | ||
) => { | ||
const { query } = UseRequestProcessor(); | ||
|
||
const getPostAuthFn = async () => { | ||
return null; | ||
}; | ||
|
||
const queryResult = query(["usePostAuth"], getPostAuthFn, options); | ||
|
||
return queryResult; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useCustomPostAuth } from "@/customization/hooks/use-custom-post-auth"; | ||
import { Outlet } from "react-router-dom"; | ||
|
||
export function AppAuthenticatedPage() { | ||
useCustomPostAuth(); | ||
|
||
return <Outlet />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters