
{% macro oauth_providers(text="Signin with #provider", size="lg", btn_block=true) %}

<div>
    {% for provider in __g.OAUTH_PROVIDERS %}
        {% set button = provider %}

        <a href="{{ url_for('UserAccount:oauth_login', provider=provider) }}"
                data-provider="{{ provider }}"
                type="button"
                class="authomatic
                      btn-oauth-login
                      btn
                      btn-social
                      btn-{{ button }}
                      btn-{{ size }}
                      {% if btn_block %} btn-block {% endif %}
        ">
            <i class="fa fa-{{ button }}"></i>
            {{ text | replace("#provider", provider) | title }}
        </a>
    {% endfor %}
</div>
<script>
    $(function(){
        var redirect = "{{ login_url_next | default(login_url_default) }}"
        Toucan.setup_authomatic(redirect)
    })
</script>
{% endmacro %}