Commit fc742752 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_core: Don't enable login buttons if the connector isnt configured

  If the login button isnt suppose to work, dont display it.
parent 7feb1a67
......@@ -3,9 +3,13 @@ oauth_login_list = []
portal_skin = context.getPortalObject().portal_skins
if getattr(portal_skin, "erp5_oauth_google_login", None) is not None:
connector = context.ERP5Site_getGoogleConnector()
if connector and connector[0].getClientId() is not None:
oauth_login_list.append("google")
if getattr(portal_skin, "erp5_oauth_facebook_login", None) is not None:
connector = context.ERP5Site_getFacebookConnector()
if connector and connector[0].getClientId() is not None:
oauth_login_list.append("facebook")
if getattr(portal_skin, "erp5_openid_connect_client", None) is not None:
......
......@@ -52,6 +52,14 @@
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getAvailableOAuthLoginList</string> </value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment