fix(auth-web): handle verify-email token links and show auth feedback
Some checks failed
CI / test (push) Failing after 1m56s

This commit is contained in:
2026-03-08 21:11:06 +03:00
parent 727df4c7f8
commit af3c5bd79e
4 changed files with 46 additions and 2 deletions

View File

@@ -1,9 +1,10 @@
import axios from "axios";
import { FormEvent, useState } from "react";
import { FormEvent, useEffect, useState } from "react";
import { checkEmailStatus, registerRequest } from "../api/auth";
import { useAuthStore } from "../store/authStore";
type Step = "email" | "password" | "register" | "otp";
const AUTH_NOTICE_KEY = "bm_auth_notice";
export function AuthPanel() {
const login = useAuthStore((s) => s.login);
@@ -20,6 +21,15 @@ export function AuthPanel() {
const [error, setError] = useState<string | null>(null);
const [success, setSuccess] = useState<string | null>(null);
useEffect(() => {
const notice = window.localStorage.getItem(AUTH_NOTICE_KEY);
if (!notice) {
return;
}
setSuccess(notice);
window.localStorage.removeItem(AUTH_NOTICE_KEY);
}, []);
async function onSubmit(event: FormEvent) {
event.preventDefault();
setError(null);