1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-23 01:20:11 +00:00

pwr: trim suffix, not prefix for links

This commit is contained in:
Harvey Tindall 2021-06-24 14:24:08 +01:00
parent 306ede47d6
commit d4096d0062
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -536,7 +536,7 @@ func (emailer *Emailer) resetValues(pwr PasswordReset, app *appContext, noSub bo
if inviteLink != "" { if inviteLink != "" {
// Strip /invite form end of this URL, ik its ugly. // Strip /invite form end of this URL, ik its ugly.
template["link_reset"] = true 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 template["pin"] = pinLink
// Only used in html email. // Only used in html email.
template["pin_code"] = pwr.Pin template["pin_code"] = pwr.Pin