PWR: TrimPrefix instead of Replace for PWR links

mautrix
Harvey Tindall 3 years ago
parent 953a66ec47
commit 561c461a18
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -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

Loading…
Cancel
Save