Google Login Integration for Themes

This documentation provides steps to integrate Google Login into the login.twig and signup.twig templates for Eternity Themes.

Requirements

  1. Google Developer Console:

    • A project needs to be set up in the Google Developer Console.
    • Enable the "Google+ API" or "Google Identity" API.
    • OAuth 2.0 credentials need to be created for web applications.
  2. Backend Configuration:

    • Ensure that the backend is configured to handle Google OAuth callbacks.
    • The google_login_active variable should be set to true when Google Login is enabled.
    • The google_login_url should be generated based on the OAuth flow.
    • Redirect google url will be yourdomain.com/auth/google.
  3. Theme Compatibility:

    • Ensure that the theme supports the inclusion of the Google Login button.
    • Check for any CSS conflicts and make adjustments as needed.

Integration Steps

  1. Modify login.twig and signup.twig Files

    Add the following code snippet to the login.twig and signup.twig files. This will insert a Google Login button if Google Login is active:

    {% if google_login_active %}
        <div id="google_login">
            <a href="{{google_login_url}}">
                <img src="https://cdn.flashypanels.com/public/uploads/ffc2128f384865d4bf26640cd5a6278f0bddad5733e46c1b40133.png" height="40">
            </a>
        </div>
    {% endif %}
    

Theme Specific Instructions

  1. For Eternity Themes

Step 1

Step 2