Merge pull request #27179 from edx/aehsan/van-401/tpa_auth_context_updated

skip hinted login field added in tpa context
This commit is contained in:
Adeel Ehsan
2021-04-01 20:08:29 +05:00
committed by GitHub
3 changed files with 7 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ class TPAContextViewTest(ThirdPartyAuthTestMixin, APITestCase):
'name': 'Facebook',
'iconClass': 'fa-facebook',
'iconImage': None,
'skipHintedLogin': False,
'loginUrl': self._third_party_login_url('facebook', 'login', params),
'registerUrl': self._third_party_login_url('facebook', 'register', params)
},
@@ -66,6 +67,7 @@ class TPAContextViewTest(ThirdPartyAuthTestMixin, APITestCase):
'name': 'Google',
'iconClass': 'fa-google-plus',
'iconImage': None,
'skipHintedLogin': False,
'loginUrl': self._third_party_login_url('google-oauth2', 'login', params),
'registerUrl': self._third_party_login_url('google-oauth2', 'register', params)
},
@@ -150,6 +152,7 @@ class TPAContextViewTest(ThirdPartyAuthTestMixin, APITestCase):
'name': 'LinkedIn',
'iconClass': 'fa-linkedin',
'iconImage': None,
'skipHintedLogin': False,
'loginUrl': self._third_party_login_url('linkedin-oauth2', 'login', params),
'registerUrl': self._third_party_login_url('linkedin-oauth2', 'register', params)
})

View File

@@ -283,6 +283,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
"name": "Dummy",
"iconClass": None,
"iconImage": settings.MEDIA_URL + "icon.svg",
"skipHintedLogin": False,
"loginUrl": self._third_party_login_url("dummy", "login", params),
"registerUrl": self._third_party_login_url("dummy", "register", params)
},
@@ -291,6 +292,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
"name": "Facebook",
"iconClass": "fa-facebook",
"iconImage": None,
"skipHintedLogin": False,
"loginUrl": self._third_party_login_url("facebook", "login", params),
"registerUrl": self._third_party_login_url("facebook", "register", params)
},
@@ -299,6 +301,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
"name": "Google",
"iconClass": "fa-google-plus",
"iconImage": None,
"skipHintedLogin": False,
"loginUrl": self._third_party_login_url("google-oauth2", "login", params),
"registerUrl": self._third_party_login_url("google-oauth2", "register", params)
},
@@ -571,7 +574,6 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
finish_auth_url = None
if current_backend:
finish_auth_url = reverse("social:complete", kwargs={"backend": current_backend}) + "?"
auth_info = {
"currentProvider": current_provider,
"platformName": settings.PLATFORM_NAME,

View File

@@ -50,6 +50,7 @@ def third_party_auth_context(request, redirect_to, tpa_hint=None):
"name": enabled.name,
"iconClass": enabled.icon_class or None,
"iconImage": enabled.icon_image.url if enabled.icon_image else None,
"skipHintedLogin": enabled.skip_hinted_login_dialog,
"loginUrl": pipeline.get_login_url(
enabled.provider_id,
pipeline.AUTH_ENTRY_LOGIN,