fix(captcha): не жечь персону на эскалации checkbox -> slider
Эскалация происходит в каждой сессии - слайдер в той же сессии проходит с тем же browser_fp и device, значит отпечаток VK не отвергал. Сжигание на ней меняло VisitorID каждый визит, хотя персона выводится из seed именно ради стабильности между визитами. Сжигание по факту отказа в token_call.go сохранено.
This commit is contained in:
1 parent
d9a0554489
commit
ee1356308b
2 files changed
+2
-10
No files matched your search
@@ -103,7 +103,6 @@ type captchaSession struct {
|
|||||||
// sensorsStart - момент ответа settings: с него виджет начинает тикать
|
// sensorsStart - момент ответа settings: с него виджет начинает тикать
|
||||||
// таймером телеметрии.
|
// таймером телеметрии.
|
||||||
sensorsStart time.Time
|
sensorsStart time.Time
|
||||||
onCompromised func()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *captchaSession) logger() logx.Logger {
|
func (s *captchaSession) logger() logx.Logger {
|
||||||
@@ -121,7 +120,6 @@ func Solve(
|
|||||||
client tlsclient.HttpClient,
|
client tlsclient.HttpClient,
|
||||||
profile browserprofile.Profile,
|
profile browserprofile.Profile,
|
||||||
log logx.Logger,
|
log logx.Logger,
|
||||||
onCompromised func(),
|
|
||||||
) (string, error) {
|
) (string, error) {
|
||||||
if captchaErr == nil || captchaErr.SessionToken == "" {
|
if captchaErr == nil || captchaErr.SessionToken == "" {
|
||||||
return "", fmt.Errorf("no session_token in redirect_uri")
|
return "", fmt.Errorf("no session_token in redirect_uri")
|
||||||
@@ -138,7 +136,6 @@ func Solve(
|
|||||||
log: l,
|
log: l,
|
||||||
browserFP: profile.VisitorID,
|
browserFP: profile.VisitorID,
|
||||||
sensors: defaultSensorConfig(),
|
sensors: defaultSensorConfig(),
|
||||||
onCompromised: onCompromised,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for attempt := 1; attempt <= captchaMaxAttempts; attempt++ {
|
for attempt := 1; attempt <= captchaMaxAttempts; attempt++ {
|
||||||
@@ -253,9 +250,6 @@ func (s *captchaSession) escalate(sessionToken string, initContent captchaConten
|
|||||||
if content.Value == "" {
|
if content.Value == "" {
|
||||||
return "", cause
|
return "", cause
|
||||||
}
|
}
|
||||||
if s.onCompromised != nil {
|
|
||||||
s.onCompromised()
|
|
||||||
}
|
|
||||||
s.logger().Debugf("[Captcha] escalated to slider in-session (content source=%s)", content.Source)
|
s.logger().Debugf("[Captcha] escalated to slider in-session (content source=%s)", content.Source)
|
||||||
// Перерисовка виджета плюс пауза на осознание.
|
// Перерисовка виджета плюс пауза на осознание.
|
||||||
if err := s.dwell(500, 1100); err != nil {
|
if err := s.dwell(500, 1100); err != nil {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
tlsclient "github.com/bogdanfinn/tls-client"
|
tlsclient "github.com/bogdanfinn/tls-client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) defaultAutoSolve(
|
func (*Client) defaultAutoSolve(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
captchaErr *captcha.Error,
|
captchaErr *captcha.Error,
|
||||||
streamID int,
|
streamID int,
|
||||||
@@ -27,9 +27,7 @@ func (c *Client) defaultAutoSolve(
|
|||||||
return "", fmt.Errorf("no redirect_uri for auto-solve")
|
return "", fmt.Errorf("no redirect_uri for auto-solve")
|
||||||
}
|
}
|
||||||
|
|
||||||
successToken, err := captcha.Solve(ctx, captchaErr, streamID, client, profile, log, func() {
|
successToken, err := captcha.Solve(ctx, captchaErr, streamID, client, profile, log)
|
||||||
c.burnPersona(streamID)
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user