update all

This commit is contained in:
Administrator 2023-10-10 00:15:30 +03:00
parent 71ee91340f
commit 21b338b256
3 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,7 @@
{% if account.vk_id %}
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
{% endif %}
<a href="https://oauth.yandex.ru/authorize?response_type=code&client_id=2c5235f2ce5b4665856d15f70aa876f2&redirect_uri=https://platform.sprinthub.ru/yandex_auth"><img style="width: 40px; height: 40px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Yandex_icon.svg/2048px-Yandex_icon.svg.png"></a>
<a href="https://oauth.yandex.ru/authorize?response_type=code&client_id=38f1906e99de4810bd79828f420ba885&redirect_uri=https://platform.sprinthub.ru/yandex_auth"><img style="width: 40px; height: 40px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Yandex_icon.svg/2048px-Yandex_icon.svg.png"></a>
{% if account.yandex_id %}
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
{% endif %}

View File

@ -20,7 +20,7 @@
</div>
или войти с помощью<br><br>
<a href="https://oauth.vk.com/authorize?client_id=8123759&redirect_uri=https://platform.sprinthub.ru/vk_auth&display=page&response_type=token&v=5.59"><img style="width: 40px; height: 40px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/VK_Compact_Logo_%282021-present%29.svg/1200px-VK_Compact_Logo_%282021-present%29.svg.png"></a>
<a href="https://oauth.yandex.ru/authorize?response_type=code&client_id=2c5235f2ce5b4665856d15f70aa876f2&redirect_uri=https://platform.sprinthub.ru/yandex_auth"><img style="width: 40px; height: 40px; margin-left: 10px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Yandex_icon.svg/2048px-Yandex_icon.svg.png"></a>
<a href="https://oauth.yandex.ru/authorize?response_type=code&client_id=38f1906e99de4810bd79828f420ba885&redirect_uri=https://platform.sprinthub.ru/yandex_auth"><img style="width: 40px; height: 40px; margin-left: 10px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Yandex_icon.svg/2048px-Yandex_icon.svg.png"></a>
</div>
</center>
</div>

View File

@ -12,7 +12,7 @@ class YandexAuthView(BaseView):
def get(self):
code = self.request.GET['code']
response = post('https://oauth.yandex.ru/token', data={
'client_id': '2c5235f2ce5b4665856d15f70aa876f2',
'client_id': '38f1906e99de4810bd79828f420ba885',
'client_secret': settings.YANDEX_SERVICE_TOKEN,
'grant_type': 'authorization_code',
'code': code
@ -33,11 +33,11 @@ class YandexAuthView(BaseView):
data = info_response.json()
yandex_id = data['id']
if self.request.user.is_authenticated:
print('Got yandex_id %s writing to db' + str(yandex_id) + " " + type(yandex_id))
print('Got yandex_id writing to db ' + str(yandex_id))
self.request.user.yandex_id = yandex_id
self.request.user.save()
else:
print('Got yandex_id %s logging in' + str(yandex_id) + " " + type(yandex_id))
print('Got yandex_id logging in' + str(yandex_id))
user = CustomUser.objects.filter(yandex_id=yandex_id).first()
if user is not None:
login(self.request, user)