Merge branch 'main' of github.com:hrfee/jfa-go

This commit is contained in:
Harvey Tindall
2025-12-19 13:12:27 +00:00
3 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -199,7 +199,7 @@ func (app *appContext) confirmMyAction(gc *gin.Context, key string) {
// Perform an Action // Perform an Action
if target == NoOp { if target == NoOp {
gc.Redirect(http.StatusSeeOther, PAGES.MyAccount) gc.Redirect(http.StatusSeeOther, MustGetNonEmptyURL(PAGES.MyAccount))
return return
} else if target == UserEmailChange { } else if target == UserEmailChange {
app.modifyEmail(id, claims["email"].(string)) app.modifyEmail(id, claims["email"].(string))
@@ -214,7 +214,7 @@ func (app *appContext) confirmMyAction(gc *gin.Context, key string) {
}, gc, true) }, gc, true)
app.info.Printf(lm.UserEmailAdjusted, gc.GetString("jfId")) app.info.Printf(lm.UserEmailAdjusted, gc.GetString("jfId"))
gc.Redirect(http.StatusSeeOther, PAGES.MyAccount) gc.Redirect(http.StatusSeeOther, MustGetNonEmptyURL(PAGES.MyAccount))
return return
} }
} }
+7
View File
@@ -66,6 +66,13 @@ func FixFullURL(v string) string {
return v return v
} }
func MustGetNonEmptyURL(path string) string {
if !strings.HasPrefix(path, "/") {
return "/" + path
}
return path
}
func FormatSubpath(path string, removeSingleSlash bool) string { func FormatSubpath(path string, removeSingleSlash bool) string {
if path == "/" { if path == "/" {
if removeSingleSlash { if removeSingleSlash {
+1 -1
View File
@@ -534,7 +534,7 @@ const addEditEmail = (add: boolean): void => {
const content = window.modals.email.modal.querySelector(".content"); const content = window.modals.email.modal.querySelector(".content");
content.classList.remove("unfocused"); 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 = () => { submit.onclick = () => {
addLoader(submit); addLoader(submit);
_post( _post(