Skip to content

Commit

Permalink
add return {}
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Apr 17, 2024
1 parent 74a045f commit 235b650
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions website/oauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@ def oauth_connect(service_name, auth):
def oauth_callback(service_name, auth):
if waffle.flag_is_active(request, features.ENABLE_GV):
_forward_to_addon_service()
else:
user = auth.user
provider = get_service(service_name)
return {}

# Retrieve permanent credentials from provider
if not provider.auth_callback(user=user):
return {}
user = auth.user
provider = get_service(service_name)

# Retrieve permanent credentials from provider
if not provider.auth_callback(user=user):
return {}

if provider.account and not user.external_accounts.filter(id=provider.account.id).exists():
user.external_accounts.add(provider.account)
user.save()
if provider.account and not user.external_accounts.filter(id=provider.account.id).exists():
user.external_accounts.add(provider.account)
user.save()

oauth_complete.send(provider, account=provider.account, user=user)
oauth_complete.send(provider, account=provider.account, user=user)

return {}

Expand Down

0 comments on commit 235b650

Please sign in to comment.