From 315d74eb2d03c5c68d3d8ab79adaa2880801239f Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 16 Dec 2025 18:32:37 +0000 Subject: [PATCH 1/2] userpage: fix redirect on contact method change root userpage paths ("") would mess up the redirect, wrapper function returns "/" if thats the case. For #455. --- api-userpage.go | 4 ++-- config.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api-userpage.go b/api-userpage.go index 39307f1..30d0081 100644 --- a/api-userpage.go +++ b/api-userpage.go @@ -199,7 +199,7 @@ func (app *appContext) confirmMyAction(gc *gin.Context, key string) { // Perform an Action if target == NoOp { - gc.Redirect(http.StatusSeeOther, PAGES.MyAccount) + gc.Redirect(http.StatusSeeOther, MustGetNonEmptyURL(PAGES.MyAccount)) return } else if target == UserEmailChange { app.modifyEmail(id, claims["email"].(string)) @@ -214,7 +214,7 @@ func (app *appContext) confirmMyAction(gc *gin.Context, key string) { }, gc, true) app.info.Printf(lm.UserEmailAdjusted, gc.GetString("jfId")) - gc.Redirect(http.StatusSeeOther, PAGES.MyAccount) + gc.Redirect(http.StatusSeeOther, MustGetNonEmptyURL(PAGES.MyAccount)) return } } diff --git a/config.go b/config.go index 300fc86..1fd2841 100644 --- a/config.go +++ b/config.go @@ -66,6 +66,13 @@ func FixFullURL(v string) string { return v } +func MustGetNonEmptyURL(path string) string { + if !strings.HasPrefix(path, "/") { + return "/" + path + } + return path +} + func FormatSubpath(path string, removeSingleSlash bool) string { if path == "/" { if removeSingleSlash { From 9b80492b4f31178c3b600243efc39086c987c2fd Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 16 Dec 2025 18:37:54 +0000 Subject: [PATCH 2/2] userpage: fix display of email confirmation required message recent adjustments to modals and CSS in general meant a "content" class was removed that was being querySelector'ed. For #455. --- ts/user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/user.ts b/ts/user.ts index 3c62dac..91a6e48 100644 --- a/ts/user.ts +++ b/ts/user.ts @@ -534,7 +534,7 @@ const addEditEmail = (add: boolean): void => { const content = window.modals.email.modal.querySelector(".content"); content.classList.remove("unfocused"); - const submit = window.modals.email.modal.querySelector(".modal-submit") as HTMLButtonElement; + const submit = window.modals.email.modal.querySelector(".card").children[0] as HTMLButtonElement; submit.onclick = () => { addLoader(submit); _post(