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:
committed by
Michilis
parent
d1d51bbb16
commit
2c3c9fb3ce
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user