Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other logins block in login.html #1

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

afsangujarati93
Copy link
Owner

Adding a block in the login template so the users can extend the login template and add the logic to add login buttons for other providers e.g. Google, Microsoft, Auth0, etc.

This is required because if the user tries to extend the login template and add the login option as follows

{% extends 'admin/login.html' %}

{% load i18n static socialaccount %}

{% block base %}
{{ block.super }}
<div class="oauth-buttons flex justify-center">
    {% if USE_GOOGLE_ALLAUTH_FOR_ADMIN %}
    <div class="mt-1 w-full sm:w-96">
        <form method="post" action="{% url 'google_login' %}">
            {% csrf_token %}
            <div class="submit-row">
                <button type="submit" class="border flex flex-row font-semibold group items-center justify-center py-2 rounded-md text-sm w-full">
                    <i class="material-symbols-outlined mr-2 relative text-lg transition-all fab fa-google"></i>
                    Sign in with Google
                </button>
            </div>
        </form>
    </div>
    {% endif %}
</div>
{% endblock %}

the button is pushed towards the bottom of the page and there's no clean way to put it right below the current login button. See the screenshot below
image

Adding a block in the login template so the users can extend the login template and add the logic to add login buttons for other providers e.g. Google, Microsoft, Auth0, etc.
@afsangujarati93 afsangujarati93 merged commit 6c7483f into main Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant