1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

PWR: TrimPrefix instead of Replace for PWR links

This commit is contained in:
Harvey Tindall 2021-05-30 00:07:18 +01:00
parent 953a66ec47
commit 561c461a18
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -535,7 +535,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.Replace(inviteLink, "/invite", "", 1), pwr.Pin)
pinLink := fmt.Sprintf("%s/reset?pin=%s", strings.TrimPrefix(inviteLink, "/invite"), pwr.Pin)
template["pin"] = pinLink
// Only used in html email.
template["pin_code"] = pwr.Pin