feat: add new server page

This commit is contained in:
--remove-section committed 2026-01-28 23:21:35 +05:30
1 parent 7804ab2b86
commit 6f2d5a5627
13 files changed
+506 -69

No files matched your search

+10 -4
View File
@@ -12,9 +12,6 @@ import { useSnackbar } from "notistack";
import { AvatarImage } from "@/components/avatar/avatar.jsx";
import "./login.scss";
import { saveUser } from "@/utils/storage/user";
import { useApiInContext } from "@/utils/store/api";
import { useBackdropStore } from "@/utils/store/backdrop.js";
import { useMutation } from "@tanstack/react-query";
import {
createFileRoute,
@@ -27,6 +24,9 @@ import React, {
useEffect,
useState,
} from "react";
import { saveUser } from "@/utils/storage/user";
import { useApiInContext } from "@/utils/store/api";
import { useBackdropStore } from "@/utils/store/backdrop.js";
export const Route = createFileRoute("/_api/login/$userId/$userName")({
component: LoginUser,
@@ -102,7 +102,13 @@ function LoginUser() {
}
createApi(api.basePath, authenticate.data?.AccessToken);
if (rememberMe) await saveUser(userName, authenticate.data.AccessToken);
if (authenticate.data.SessionInfo?.UserId && rememberMe) {
await saveUser(
userName,
authenticate.data.AccessToken,
authenticate.data.SessionInfo.UserId,
);
}
router.invalidate().finally(() => {
navigate({ to: "/home", replace: true });