fix: заменить устаревший token_type=messages на анонимные скоупы в VK авторизации

This commit is contained in:
samosvalishe
2026-06-24 11:35:10 +03:00
parent 2a76159040
commit 384c350e7d
@@ -12,8 +12,8 @@ import (
// fetchAnonToken - шаг 1 цепочки: обменивает app client_id/client_secret
// на анонимный access token из login.vk.ru.
func (c *Client) fetchAnonToken(ctx context.Context, httpClient tlsclient.HttpClient, profile browserprofile.Profile, creds VKCredentials) (string, error) {
data := fmt.Sprintf("client_id=%s&token_type=messages&client_secret=%s&version=1&app_id=%s",
creds.ClientID, creds.ClientSecret, creds.ClientID)
data := fmt.Sprintf("client_secret=%s&client_id=%s&scopes=audio_anonymous,video_anonymous,photos_anonymous,profile_anonymous&isApiOauthAnonymEnabled=false&version=1&app_id=%s",
creds.ClientSecret, creds.ClientID, creds.ClientID)
resp, err := c.doRequest(ctx, httpClient, profile, data, "https://login.vk.ru/?act=get_anonym_token")
if err != nil {
return "", err