update all
This commit is contained in:
parent
71ee91340f
commit
21b338b256
@ -55,7 +55,7 @@
|
|||||||
{% if account.vk_id %}
|
{% if account.vk_id %}
|
||||||
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
|
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
|
||||||
{% endif %}
|
{% 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 %}
|
{% if account.yandex_id %}
|
||||||
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
|
<div style="margin-top: -15px; margin-left: 30px;"><i style="color: green;" class="fa fa-check-circle"></i></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
или войти с помощью<br><br>
|
или войти с помощью<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.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>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,7 +12,7 @@ class YandexAuthView(BaseView):
|
|||||||
def get(self):
|
def get(self):
|
||||||
code = self.request.GET['code']
|
code = self.request.GET['code']
|
||||||
response = post('https://oauth.yandex.ru/token', data={
|
response = post('https://oauth.yandex.ru/token', data={
|
||||||
'client_id': '2c5235f2ce5b4665856d15f70aa876f2',
|
'client_id': '38f1906e99de4810bd79828f420ba885',
|
||||||
'client_secret': settings.YANDEX_SERVICE_TOKEN,
|
'client_secret': settings.YANDEX_SERVICE_TOKEN,
|
||||||
'grant_type': 'authorization_code',
|
'grant_type': 'authorization_code',
|
||||||
'code': code
|
'code': code
|
||||||
@ -33,11 +33,11 @@ class YandexAuthView(BaseView):
|
|||||||
data = info_response.json()
|
data = info_response.json()
|
||||||
yandex_id = data['id']
|
yandex_id = data['id']
|
||||||
if self.request.user.is_authenticated:
|
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.yandex_id = yandex_id
|
||||||
self.request.user.save()
|
self.request.user.save()
|
||||||
else:
|
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()
|
user = CustomUser.objects.filter(yandex_id=yandex_id).first()
|
||||||
if user is not None:
|
if user is not None:
|
||||||
login(self.request, user)
|
login(self.request, user)
|
||||||
|
Loading…
Reference in New Issue
Block a user