psy_vk / index.html
DmitrMakeev's picture
Update index.html
69cdf57 verified
raw
history blame
1.55 kB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My static Space</title>
<link rel="stylesheet" href="https://huggingface.co/spaces/vk-ai-system/flask_inference_api/resolve/main/style.css" />
</head>
<body>
<div>
<script src="https://unpkg.com/@vkid/sdk@<3.0.0/dist-sdk/umd/index.js"></script>
<script type="text/javascript">
if ("VKIDSDK" in window) {
const VKID = window.VKIDSDK;
VKID.Config.init({
"app": 52295022,
"redirectUrl": "https://dmtuit-psy-vk.hf.space/pages",
"source": VKID.ConfigSource.LOWCODE,
});
const oneTap = new VKID.OneTap();
oneTap.render({
"container": document.currentScript.parentElement,
"showAlternativeLogin": true,
"styles": {
"width": 360,
"height": 56
},
"oauthList": [
"ok_ru",
"mail_ru"
]
})
.on(VKID.WidgetEvents.ERROR, vkidOnError)
.on(VKID.OneTapInternalEvents.LOGIN_SUCCESS, function (payload) {
const code = payload.code;
const deviceId = payload.device_id;
VKID.Auth.exchangeCode(code, deviceId)
.then(vkidOnSuccess)
.catch(vkidOnError);
});
}
function vkidOnSuccess(data) {
// Обработка полученного результата
}
function vkidOnError(error) {
// Обработка ошибки
}
</script>
</div>
</body>
</html>