5f7a14fde8cdb24b01fc0e5eadba145bfd9ecb04
max
Sat Jul 25 23:16:06 2026 -0700
hgLogin: social login (Google/ORCID), email login link, change email. refs #37929
diff --git src/hg/js/topLinks.js src/hg/js/topLinks.js
index 62cca2e458f..0ffa1e94e6b 100644
--- src/hg/js/topLinks.js
+++ src/hg/js/topLinks.js
@@ -86,57 +86,60 @@
});
document.addEventListener("keydown", onKey, true); // capture: run before other handlers
closeCurrent = function() {
document.removeEventListener("keydown", onKey, true);
if (overlay.parentNode) overlay.parentNode.removeChild(overlay);
};
return body;
}
// ---- Login / account dialog --------------------------------------------------------------
function showLoginDialog(link) {
var user = link.getAttribute("data-username");
var logoutUrl = link.getAttribute("data-logouturl");
var changePwUrl = link.getAttribute("data-changepwurl");
+ var changeEmailUrl = link.getAttribute("data-changeemailurl");
var body = document.createElement("div");
var p = el("p");
p.appendChild(document.createTextNode("Signed in as "));
p.appendChild(el("b", {textContent: user})); // textContent avoids HTML injection
p.appendChild(document.createTextNode("."));
body.appendChild(p);
// helper: add an
to a list
function addLink(ul, href, text) {
var li = el("li", {}, {margin: "6px 0"});
li.appendChild(el("a", {href: href, textContent: text}));
ul.appendChild(li);
}
// "My Data" navigation: sessions, custom tracks, uploaded track hubs (hubSpace).
var hgsid = getHgsidSafe();
var navUl = el("ul", {}, {listStyle: "none", margin: "0 0 10px 0", padding: "0"});
addLink(navUl, "../cgi-bin/hgSession?hgS_doMainPage=1&hgsid=" + hgsid, "My Sessions");
addLink(navUl, "../cgi-bin/hgCustom?hgsid=" + hgsid, "My Custom Tracks");
addLink(navUl, "../cgi-bin/hgHubConnect?hgsid=" + hgsid + "#hubUpload", "My Track Hubs");
body.appendChild(navUl);
// Account actions.
var ul = el("ul", {}, {listStyle: "none", margin: "0", padding: "0",
borderTop: "1px solid #ddd", paddingTop: "8px"});
if (changePwUrl)
addLink(ul, changePwUrl, "Change password");
+ if (changeEmailUrl)
+ addLink(ul, changeEmailUrl, "Change email");
addLink(ul, logoutUrl, "Sign out");
body.appendChild(ul);
showModal("Account", body);
}
// ---- Share a link ------------------------------------------------------------------------
function getHgsidSafe() {
if (typeof getHgsid === "function")
return getHgsid();
var m = /[?&]hgsid=([^&]+)/.exec(window.location.search);
return m ? m[1] : "";
}
// Clipboard SVG icon (same FontAwesome glyph used by printCopyToClipboardButton in hgSession.c).