This commit is contained in:
Mateusz Gruszczyński
2026-07-27 12:03:18 +02:00
parent 3f27aa10b3
commit 63999f0878
8 changed files with 43 additions and 21 deletions
+11 -1
View File
@@ -84,7 +84,16 @@ document.querySelector("#workspace-form").addEventListener("submit", async (even
handleAccountConfirmationToken();
handleResetToken();
{ const params=new URLSearchParams(location.search); const token=params.get("account_action_token"); if(token){ api("/api/auth/account-action/confirm",{method:"POST",body:JSON.stringify({token})}).then(r=>alert(r.message)).catch(e=>alert(e.message)).finally(()=>{params.delete("account_action_token");history.replaceState({},"",`${location.pathname}${params.size?`?${params}`:""}${location.hash}`);}); } }
function toast(text) {
const element = document.querySelector("#toast");
if (!element) return;
element.textContent = text;
element.classList.add("visible");
clearTimeout(toast.timer);
toast.timer = setTimeout(() => element.classList.remove("visible"), 3000);
}
{ const params=new URLSearchParams(location.search); const token=params.get("account_action_token"); if(token){ api("/api/auth/account-action/confirm",{method:"POST",body:JSON.stringify({token})}).then(r=>toast(r.message)).catch(e=>toast(e.message)).finally(()=>{params.delete("account_action_token");history.replaceState({},"",`${location.pathname}${params.size?`?${params}`:""}${location.hash}`);}); } }
const identityDialog = document.querySelector("#identity-dialog");
const guestAccount = document.querySelector("#footer-account-guest");
@@ -260,6 +269,7 @@ if (identityDialog) {
document.querySelector("#footer-profile")?.addEventListener("click", () => {
document.querySelector("#profile-nickname").value = currentSession?.nickname || "";
document.querySelector("#profile-current-email").value = currentSession?.email || "";
document.querySelector("#profile-email").value = "";
document.querySelector("#profile-new-password").value = "";
document.querySelector("#profile-password").value = "";