Only let the requesting user confirm an LNURL-auth login

The confirm handler signed the stored challenge with the key of whoever pressed the button. Check the owner like the cancel handler does.

(cherry picked from commit 547568cadcfd28d5ae94a1eb30f25dd0cfa03f91)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin Ravensberg
2026-11-13 20:33:45 +00:00
committed by Michilis
parent d1d51bbb16
commit 2c3c9fb3ce
+5
View File
@@ -85,6 +85,11 @@ func (bot *TipBot) confirmLnurlAuthHandler(ctx intercept.Context) (intercept.Con
}
lnurlAuthState := sn.(*LnurlAuthState)
// only the correct user can press
if lnurlAuthState.From.Telegram.ID != c.Sender.ID {
return ctx, errors.Create(errors.UnknownError)
}
if !lnurlAuthState.Active {
return ctx, fmt.Errorf("LnurlAuthData not active.")
}