mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-11-01 22:55:44 +00:00
refactor: rename site to frontend
This commit is contained in:
17
frontend/src/App.tsx
Normal file
17
frontend/src/App.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Navigate } from "react-router";
|
||||
import { useUserContext } from "./context/user-context";
|
||||
import { LogoutPage } from "./pages/logout-page";
|
||||
|
||||
export const App = () => {
|
||||
const queryString = window.location.search;
|
||||
const params = new URLSearchParams(queryString);
|
||||
const redirectUri = params.get("redirect_uri");
|
||||
|
||||
const { isLoggedIn } = useUserContext();
|
||||
|
||||
if (!isLoggedIn) {
|
||||
return <Navigate to={`/login?redirect_uri=${redirectUri}`} />;
|
||||
}
|
||||
|
||||
return <LogoutPage />;
|
||||
};
|
||||
Reference in New Issue
Block a user