d33d0e1c19117a0347dbadb99a77e9f12483c735
max
  Tue Sep 1 06:56:09 2026 -0700
hgLogin: let users set or change their recovery email address, refs #38197

Adds a page where a signed-in user can set or change the recovery address on
their account, offered in the account menu next to "Change email" -- both in
the top right blue bar popup and on the session page. It is off by default:
set login.recovEmailChange=on in hg.conf to offer it. The page also needs
login.cookieSalt, working outbound mail and the recovEmailVerified column,
and stays hidden where any of those is missing.

The new address is confirmed by mail before it takes effect, so whatever is
on the account keeps working until the link is opened and a typo costs the
user nothing. An account that has a password must supply it, since a
confirmed recovery address can sign in. Once the address does change, the
account's main address is told, the same notice that a change of the main
address already sends.

One signature now covers both the address given at signup and a later
change, so there is a single confirmation path rather than two.

diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c
index 8d9a2f6f8a8..c80852dc5ad 100644
--- src/hg/hgSession/hgSession.c
+++ src/hg/hgSession/hgSession.c
@@ -95,30 +95,33 @@
 
 if (loginSystemEnabled()) /* Using the new hgLogin CGI for login */
     {
     printf("<h4 style=\"margin: 0pt 0pt 7px;\">Your Account Information</h4>"
         "<ul style=\"list-style: none outside none; margin: 0pt; padding: 0pt;\">"
         "<li>Username:  %s</li>",wikiUserName);
 
     if (loginUseBasicAuth())
         printf("<li>The Genome Browser is configured to use HTTP Basic Authentication, so the password cannot be changed here.</li>");
     else
         printf("<li><A HREF=\"%s\">Change password</A></li>",
             wikiLinkChangePasswordUrl(cartSessionId(cart)));
     char *changeEmailUrl = wikiLinkChangeEmailUrl(cartSessionId(cart));
     if (changeEmailUrl != NULL)
         printf("<li><A HREF=\"%s\">Change email</A></li>", changeEmailUrl);
+    char *changeRecovEmailUrl = wikiLinkChangeRecovEmailUrl(cartSessionId(cart));
+    if (changeRecovEmailUrl != NULL)
+        printf("<li><A HREF=\"%s\">Recovery email</A></li>", changeRecovEmailUrl);
     printf("</ul>");
 
     printf("<p><A id='logoutLink' HREF=\"%s\">Sign out</A></p>",
         wikiLinkUserLogoutUrl(cartSessionId(cart)));
 
     if (loginUseBasicAuth())
             wikiFixLogoutLinkWithJs();
     }
 
 else
 /* this part is not used anymore at UCSC since 2014 */
     {
     printf("If you are not %s (on the wiki at "
         "<A HREF=\"http://%s/\" TARGET=_BLANK>%s</A>) "
         "and would like to sign out or change identity, \n",