Skip to content

Commit 2612cdd

Browse files
authored
fix: Change domains for VK backend (#1255)
* Change domains for VK backend * Fix tests for VK backend
1 parent 92d5380 commit 2612cdd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

social_core/backends/vk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class VKOAuth2(BaseOAuth2):
9393

9494
name = "vk-oauth2"
9595
ID_KEY = "id"
96-
AUTHORIZATION_URL = "https://oauth.vk.com/authorize"
97-
ACCESS_TOKEN_URL = "https://oauth.vk.com/access_token"
96+
AUTHORIZATION_URL = "https://oauth.vk.ru/authorize"
97+
ACCESS_TOKEN_URL = "https://oauth.vk.ru/access_token"
9898
EXTRA_DATA = [("id", "id"), ("expires_in", "expires")]
9999

100100
def get_user_details(self, response):
@@ -158,11 +158,11 @@ def vk_api(self, method: str, data: dict[str, str]) -> dict[Any, Any] | None:
158158

159159
data["method"] = method
160160
data["format"] = "json"
161-
url = "https://api.vk.com/api.php"
161+
url = "https://api.vk.ru/api.php"
162162
param_list = sorted(item + "=" + data[item] for item in data)
163163
data["sig"] = vk_sig("".join(param_list) + secret)
164164
else:
165-
url = "https://api.vk.com/method/" + method
165+
url = "https://api.vk.ru/method/" + method
166166

167167
try:
168168
return self.get_json(url, params=data)

social_core/tests/backends/test_vk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class VKOAuth2Test(OAuth2Test, BaseAuthUrlTestMixin):
77
backend_path = "social_core.backends.vk.VKOAuth2"
8-
user_data_url = "https://api.vk.com/method/users.get"
8+
user_data_url = "https://api.vk.ru/method/users.get"
99
expected_username = "durov"
1010
access_token_body = json.dumps({"access_token": "foobar", "token_type": "bearer"})
1111
user_data_body = json.dumps(

0 commit comments

Comments
 (0)