Skip to content

Commit c2c8653

Browse files
chore: switch off my id from testing
1 parent dce18b4 commit c2c8653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routes/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func (h *LoginHandler) PostResetPassword(w http.ResponseWriter, r *http.Request)
407407
} else {
408408
go func(user *models.User) {
409409
link := fmt.Sprintf("%s/set-password?token=%s", h.config.Server.GetPublicUrl(), user.ResetToken)
410-
if h.config.Security.AirtableAPIKey != "" && resetRequest.Slack {
410+
if h.config.Security.AirtableAPIKey != "" && resetRequest.Slack && strings.HasPrefix(user.ID, "U") {
411411
msgtext := fmt.Sprintf("Arr `%s`! Looks liek ye requested a password reset from hackatime for the email `%s`! If ye didn't request this then sombardy is trying to hack thee account and you should steer clear of below button :tw_crossed_swords:", func() string {
412412
if user.Name == "" {
413413
return "matey"
@@ -439,7 +439,7 @@ func (h *LoginHandler) PostResetPassword(w http.ResponseWriter, r *http.Request)
439439
]
440440
}
441441
]`
442-
if err := utils.SendSlackMessage(h.config.Security.AirtableAPIKey, "U062UG485EE", msg, blocks); err != nil {
442+
if err := utils.SendSlackMessage(h.config.Security.AirtableAPIKey, user.ID, msg, blocks); err != nil {
443443
conf.Log().Request(r).Error("failed to send slack message", "error", err)
444444
} else {
445445
slog.Info("sent slack message", "userID", user.ID)

0 commit comments

Comments
 (0)