confirmed SSR support with Remix

This commit is contained in:
dswbx
2024-11-25 19:59:46 +01:00
parent 1c94777317
commit eea76ebc28
15 changed files with 144 additions and 44 deletions

View File

@@ -14,6 +14,7 @@ import {
} from "react-icons/tb";
import { Button } from "ui";
import { useAuth, useBknd } from "ui/client";
import { useBkndWindowContext } from "ui/client/BkndProvider";
import { useBkndSystemTheme } from "ui/client/schema/system/use-bknd-system";
import { IconButton } from "ui/components/buttons/IconButton";
import { Logo } from "ui/components/display/Logo";
@@ -147,11 +148,12 @@ export function Header({ hasSidebar = true }) {
function UserMenu() {
const auth = useAuth();
const [navigate] = useNavigate();
const { logout_route } = useBkndWindowContext();
async function handleLogout() {
await auth.logout();
// @todo: grab from somewhere constant
window.location.href = "/auth/logout";
navigate(logout_route, { reload: true });
}
async function handleLogin() {