DmitrMakeev commited on
Commit
19366da
·
verified ·
1 Parent(s): f074f35

Update user.html

Browse files
Files changed (1) hide show
  1. user.html +15 -44
user.html CHANGED
@@ -6,51 +6,22 @@
6
  <title>VK Authorization</title>
7
  </head>
8
  <body>
9
- <div>
10
- <script src="https://unpkg.com/@vkid/sdk@<3.0.0/dist-sdk/umd/index.js"></script>
11
- <script type="text/javascript">
12
- if ("VKIDSDK" in window) {
13
- const VKID = window.VKIDSDK;
 
 
14
 
15
- VKID.Config.init({
16
- "app": 52295022,
17
- "redirectUrl": "https://dmtuit-psy-vk.hf.space/pages",
18
- "source": VKID.ConfigSource.LOWCODE,
19
- });
20
-
21
- const oneTap = new VKID.OneTap();
22
-
23
- oneTap.render({
24
- "container": document.currentScript.parentElement,
25
- "showAlternativeLogin": true,
26
- "styles": {
27
- "width": 360
28
- },
29
- "oauthList": [
30
- "ok_ru",
31
- "mail_ru"
32
- ]
33
- })
34
- .on(VKID.WidgetEvents.ERROR, vkidOnError)
35
- .on(VKID.OneTapInternalEvents.LOGIN_SUCCESS, function (payload) {
36
- const code = payload.code;
37
- const deviceId = payload.device_id;
38
-
39
- VKID.Auth.exchangeCode(code, deviceId)
40
- .then(vkidOnSuccess)
41
- .catch(vkidOnError);
42
- });
43
- }
44
-
45
- function vkidOnSuccess(data) {
46
- // Обработка полученного результата
47
- }
48
-
49
- function vkidOnError(error) {
50
- // Обработка ошибки
51
- }
52
- </script>
53
- </div>
54
 
55
  </body>
56
  </html>
 
6
  <title>VK Authorization</title>
7
  </head>
8
  <body>
9
+ <div id="vk_api_transport"></div>
10
+ <script type="text/javascript">
11
+ window.vkAsyncInit = function() {
12
+ VK.init({
13
+ apiId: 52295022
14
+ });
15
+ };
16
 
17
+ setTimeout(function() {
18
+ var el = document.createElement("script");
19
+ el.type = "text/javascript";
20
+ el.src = "https://vk.com/js/api/openapi.js?169";
21
+ el.async = true;
22
+ document.getElementById("vk_api_transport").appendChild(el);
23
+ }, 0);
24
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  </body>
27
  </html>