yandex auth, bug fixes

This commit is contained in:
Ivan
2024-01-29 21:31:16 +03:00
parent 0b1d5e8b79
commit 24d47644d4
5 changed files with 188 additions and 10 deletions

View File

@@ -16,6 +16,30 @@
import { minidenticonSvg } from 'https://cdn.jsdelivr.net/npm/minidenticons@4.2.0/minidenticons.min.js'
</script>
<script src="../scripts/projects.js"></script>
<script src="https://yastatic.net/s3/passport-sdk/autofill/v1/sdk-suggest-with-polyfills-latest.js"></script>
<script>
window.YaAuthSuggest.init(
{
client_id: '8976c8bc90784da89467f3abd34f0192',
response_type: 'token',
redirect_uri: '{{SITE_DOMAIN}}/yandexconnect'
}
,
'{{SITE_DOMAIN}}',
{
view: "button",
parentId: "yandexButtonContainerId",
buttonSize: 's',
buttonView: 'main',
buttonTheme: 'light',
buttonBorderRadius: "4",
buttonIcon: 'ya',
}
)
.then(({handler}) => handler())
.then(data => console.log('Сообщение с токеном', data))
.catch(error => console.log('Обработка ошибки', error))
</script>
</head>
<body>
@@ -188,6 +212,21 @@
<button id="password-button" class="inactive" onclick="updatePassword();" type="button">Сохранить</button>
</div>
</div>
<div class="setting-section">
<div class="setting-top">
<h1>Авторизация через Яндекс</h1>
{{#if User.yandexid}}
<h2>Аккаунт Яндекса успешно привязан</h2>
{{else}}
<h2>Если хотите входить в аккаунт через Яндекс, вам необходимо привязать его ниже</h2>
{{/if}}
</div>
<div class="setting-bottom">
<h2>Нажмите на кнопочку справа.</h2>
<div style="width: 200px; border-radius: 6px;" id="yandexButtonContainerId"></div>
</div>
</div>
</div>