diff --git a/sfdo_template_helpers/oauth2/salesforce/views.py b/sfdo_template_helpers/oauth2/salesforce/views.py index 02454e7..b71a320 100644 --- a/sfdo_template_helpers/oauth2/salesforce/views.py +++ b/sfdo_template_helpers/oauth2/salesforce/views.py @@ -45,10 +45,7 @@ def base_url(self): return base_url def complete_login(self, request, app, token, **kwargs): - # make sure token is attached to a SocialApp in the db - #Social app is retrieved from the settings.SOCIALACCOUNT_PROVIDERS - #ensure_socialapp_in_db(token, app) - + token = fernet_decrypt(token.token) headers = {"Authorization": f"Bearer {token}"} verifier = request.session["socialaccount_state"][1] @@ -137,25 +134,6 @@ def parse_token(self, data): return super().parse_token(data) -# @W-14777545 - Disabling ensure social app in db -# def ensure_socialapp_in_db(token, social_app): -# """Make sure that token is attached to a SocialApp in the db. - -# Since we are using SocialApps constructed from settings, -# there are none in the db for tokens to be related to -# unless we create them here. -# """ -# if social_app is None: -# social_app = token.app - -# if getattr(social_app ,'pk', None) is None: -# provider = providers.registry.get_class(social_app.provider) -# app, created = SocialApp.objects.get_or_create( -# provider=provider.id, -# name=provider.name, -# client_id="-", -# ) -# token.app = app oauth2_login = OAuth2LoginView.adapter_view(SalesforceOAuth2Adapter)