From d4096d00621ac0c250248c0f81f5e3e26cfa549c Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Thu, 24 Jun 2021 14:24:08 +0100 Subject: [PATCH] pwr: trim suffix, not prefix for links --- email.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email.go b/email.go index 88a8bdb..d5b4492 100644 --- a/email.go +++ b/email.go @@ -536,7 +536,7 @@ func (emailer *Emailer) resetValues(pwr PasswordReset, app *appContext, noSub bo if inviteLink != "" { // Strip /invite form end of this URL, ik its ugly. template["link_reset"] = true - pinLink := fmt.Sprintf("%s/reset?pin=%s", strings.TrimPrefix(inviteLink, "/invite"), pwr.Pin) + pinLink := fmt.Sprintf("%s/reset?pin=%s", strings.TrimSuffix(inviteLink, "/invite"), pwr.Pin) template["pin"] = pinLink // Only used in html email. template["pin_code"] = pwr.Pin