Ensure ping after auth

This commit is contained in:
2025-11-26 16:32:46 +03:00
Unverified
parent abbd3e2db9
commit 3549f98691
2 changed files with 59 additions and 0 deletions
+8
View File
@@ -12,6 +12,7 @@ import { isElectron } from "@/core/electron/electron";
import type { Alert, AlertType } from "./Auth";
import { AuthHeader, AlertsContainer } from "./Auth";
import styles from "./auth.module.scss";
import { ensureAuthenticated } from "@/core/websocket";
const loginFieldVariants: Variants = {
initial: {
@@ -95,6 +96,13 @@ export function LoginForm({ onSwitchMode }: LoginFormProps) {
console.error("Key setup failed:", e);
}
// Ensure WebSocket is connected and authenticated
try {
await ensureAuthenticated();
} catch (e) {
console.error("WebSocket authentication failed:", e);
}
navigate("/chat");
try {