mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-23 03:25:07 +03:00
Ensure ping after auth
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user