BS-001 Initialize BortStack foundation and project workflow
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
|
||||
export default function VerifyEmail() {
|
||||
const [params] = useSearchParams();
|
||||
const token = params.get("token");
|
||||
const [message, setMessage] = useState("Verifying email…");
|
||||
|
||||
useEffect(() => {
|
||||
fetch("/api/user/verify-email", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ token }),
|
||||
}).then(async (response) => {
|
||||
const data = await response.json();
|
||||
setMessage(response.ok ? "Email verified. You can now log in." : data.message || "Unable to verify email");
|
||||
}).catch(() => setMessage("Unable to verify email"));
|
||||
}, [token]);
|
||||
|
||||
return <main><p role="status">{message}</p></main>;
|
||||
}
|
||||
Reference in New Issue
Block a user