Commit 807c3900 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_oauth2_authorisation: Supports external login and erp5_credential if installed.

If erp5_credential is installed in ERP5, we will use the dialog from erp5_credential instead of accessing portal_password directly.
parent 0345d19e
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
js_list python: [portal_url + '/erp5.js']; js_list python: [portal_url + '/erp5.js'];
came_from python: request.get('came_from'); came_from python: request.get('came_from');
ERP5Site python: modules['Products.ERP5.ERP5Site']; ERP5Site python: modules['Products.ERP5.ERP5Site'];
portal python: context.getPortalObject();
web_site_value python: context.getWebSiteValue();
root_absolute_url python: (portal if web_site_value is None else web_site_value).absolute_url() + '/';
available_oauth_login_list python: portal.ERP5Site_getAvailableOAuthLoginList();
enable_google_login python: 'google' in available_oauth_login_list;
enable_facebook_login python: 'facebook' in available_oauth_login_list;
enable_openidconnect_login python: 'openidconnect' in available_oauth_login_list;
" "
> >
<tal:block metal:use-macro="python: context.main_template.macros['master']"> <tal:block metal:use-macro="python: context.main_template.macros['master']">
...@@ -56,15 +63,47 @@ ...@@ -56,15 +63,47 @@
<div class="field"> <div class="field">
<label>&nbsp;</label> <label>&nbsp;</label>
<div class="input"> <div class="input">
<a <a tal:define="default_href python: portal_url + '/portal_password/PasswordTool_viewEmailPassword';
tal:attributes=" credential_href string:${here/portal_url}/ERP5Site_viewCredentialRecoveryLoginDialog;"
href python: portal_url + '/portal_password/PasswordTool_viewEmailPassword'; tal:attributes="href python: credential_href if getattr(portal.portal_skins, 'erp5_credential', None) else default_href"
"
i18n:translate="" i18n:translate=""
i18n:domain="ui" i18n:domain="ui"
>I forgot my password!</a> >I forgot my password!</a>
</div> </div>
</div> </div>
<tal:block tal:condition="enable_google_login">
<div class="field">
<label>&nbsp;</label>
<div class="input">
<a tal:attributes="href string:${here/portal_url}/ERP5Site_redirectToGoogleLoginPage"
i18n:translate="" i18n:domain="ui" class="google">
<img alt="Sign in with Google" src="google_login_button.png"/>
</a>
</div>
</div>
</tal:block>
<tal:block tal:condition="enable_facebook_login">
<div class="field">
<label>&nbsp;</label>
<div class="input">
<a tal:attributes="href string:${here/portal_url}/ERP5Site_redirectToFacebookLoginPage"
i18n:translate="" i18n:domain="ui">
<img alt="Login with Facebook" src="facebook_login_button.png">
</a>
</div>
</div>
</tal:block>
<tal:block tal:condition="enable_openidconnect_login">
<div class="field">
<label>&nbsp;</label>
<div class="input">
<a tal:attributes="href string:${here/portal_url}/ERP5Site_redirectToOpenIdLoginPage"
i18n:translate="" i18n:domain="ui">
<img alt="Sign in with OpenID Connect" src="openid_login_button.png"/>
</a>
</div>
</div>
</tal:block>
</fieldset> </fieldset>
<p i18n:translate="" i18n:domain="ui">Having trouble logging in? Make sure to enable cookies in your web browser.</p> <p i18n:translate="" i18n:domain="ui">Having trouble logging in? Make sure to enable cookies in your web browser.</p>
<p i18n:translate="" i18n:domain="ui">Do not forget to logout or exit your browser when you are done.</p> <p i18n:translate="" i18n:domain="ui">Do not forget to logout or exit your browser when you are done.</p>
......
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