fix: don't show social login icon if not set
This commit is contained in:
parent
aa8f7cc3c5
commit
91cb71f0c9
2 changed files with 12 additions and 7 deletions
|
|
@ -85,7 +85,10 @@
|
|||
<div class="login-button-wrapper">
|
||||
<a href="{{ provider.auth_url }}"
|
||||
class="btn btn-block btn-default btn-sm btn-login-option btn-{{ provider.name }}">
|
||||
{{ provider.icon }} {{ _("Login With") }} {{ provider.provider_name }}</a>
|
||||
{% if provider.icon %}
|
||||
{{ provider.icon }}
|
||||
{% endif %}
|
||||
{{ _("Login With") }} {{ provider.provider_name }}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<p class="text-muted login-divider">{{ _("or") }}</p>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ def get_context(context):
|
|||
redirect_to = get_home_page()
|
||||
else:
|
||||
redirect_to = "/app"
|
||||
|
||||
|
||||
if redirect_to != 'login':
|
||||
frappe.local.flags.redirect_location = redirect_to
|
||||
raise frappe.Redirect
|
||||
|
|
@ -44,11 +44,13 @@ def get_context(context):
|
|||
client_secret = get_decrypted_password("Social Login Key", provider, "client_secret")
|
||||
provider_name = frappe.get_value("Social Login Key", provider, "provider_name")
|
||||
|
||||
if provider_name != "Custom":
|
||||
icon_url = frappe.get_value("Social Login Key", provider, "icon")
|
||||
icon = "<img src='{0}' alt={1}>".format(icon_url, provider_name)
|
||||
else:
|
||||
icon = get_icon_html(frappe.get_value("Social Login Key", provider, "icon"), small=True)
|
||||
icon = None
|
||||
icon_url = frappe.get_value("Social Login Key", provider, "icon")
|
||||
if icon_url:
|
||||
if provider_name != "Custom":
|
||||
icon = "<img src='{0}' alt={1}>".format(icon_url, provider_name)
|
||||
else:
|
||||
icon = get_icon_html(icon_url, small=True)
|
||||
|
||||
if (get_oauth_keys(provider) and client_secret and client_id and base_url):
|
||||
context.provider_logins.append({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue