42OAuth #41

Merged
Danhia merged 6 commits from 42OAuth into main 2022-03-29 21:03:48 +02:00
1 changed files with 0 additions and 2 deletions
Showing only changes of commit e480aec493 - Show all commits

View File

@ -36,7 +36,6 @@ def connect_intra42(request):
site = Site.objects.get_current() site = Site.objects.get_current()
redirect_uri = reverse('accounts:connections-connect-intra42-authorize') redirect_uri = reverse('accounts:connections-connect-intra42-authorize')
redirect_uri = "https://" + site.domain + redirect_uri[3:] # remove language code redirect_uri = "https://" + site.domain + redirect_uri[3:] # remove language code
print(redirect_uri)
return oauth.intra42.authorize_redirect(request, redirect_uri) return oauth.intra42.authorize_redirect(request, redirect_uri)
@login_required @login_required
@ -90,7 +89,6 @@ def authorize_discord(request):
return redirect('accounts:edit') return redirect('accounts:edit')
response = oauth.discord.get('users/@me', token=token) response = oauth.discord.get('users/@me', token=token)
response = response.json() response = response.json()
print(response)
discord_id = response['id'] discord_id = response['id']
request.user.userprofileinfo.discord_id = discord_id request.user.userprofileinfo.discord_id = discord_id
request.user.userprofileinfo.save() request.user.userprofileinfo.save()