FEAT: OAuth now redirects to last URL signed in
UPDATE: Created the page to display lists of categories
This commit is contained in:
@@ -8,6 +8,7 @@ import NotFoundPage from "./pages/NotFoundPage";
|
||||
import UserPage from "./pages/UserPage";
|
||||
import ResetPasswordPage from "./pages/ResetPasswordPage";
|
||||
import CategoryPage from "./pages/CategoryPage";
|
||||
import CategoriesPage from "./pages/CategoriesPage";
|
||||
|
||||
function App() {
|
||||
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
||||
@@ -44,6 +45,7 @@ function App() {
|
||||
<Route path="/user/:username" element={<UserPage />} />
|
||||
<Route path="/reset_password/:token" element={<ResetPasswordPage />}></Route>
|
||||
<Route path="/category/:category_name" element={<CategoryPage />}></Route>
|
||||
<Route path="/category" element={<CategoriesPage />}></Route>
|
||||
|
||||
<Route path="/404" element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
|
||||
@@ -3,7 +3,8 @@ import { useEffect } from "react";
|
||||
export default function GoogleLogin() {
|
||||
const handleLoginClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.preventDefault();
|
||||
window.location.href = "/api/login/google";
|
||||
const nextUrl = encodeURIComponent(window.location.href);
|
||||
window.location.href = `/api/login/google?next=${nextUrl}`;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
11
frontend/src/pages/CategoriesPage.tsx
Normal file
11
frontend/src/pages/CategoriesPage.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
const CategoriesPage: React.FC = () => {
|
||||
return (
|
||||
<div className="categories-page">
|
||||
<h1>Categories Page</h1>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CategoriesPage;
|
||||
Reference in New Issue
Block a user