Store the session token issued at sign in

This commit is contained in:
gator 2026-09-07 12:39:36 +00:00
parent c4bc712972
commit ca5c25ef14

View file

@ -61,7 +61,8 @@ document.getElementById("form").addEventListener("submit", async function (e) {
btn.disabled = false; btn.textContent = "Continue";
if (!r.ok) { showMsg("msg", r.error || "That did not work. Please try again."); return; }
Session.set(r.user.email, r.user.display_name || name);
// The token is the credential from here on; the email is only for display.
Session.start(r, r.user.email, r.user.display_name || name);
showMsg("msg", r.returning ? "Welcome back. Taking you through…" : "Account created. Taking you through…", "ok");
setTimeout(function () { location.href = next; }, 550);
});