Bypass the account creation modal when using OAuth2

The ugly workaround I found for the time being:

  • Enable local logins

  • Create users beforehand via the API

  • Create a new Component in the theme

    • CSS
    .sign-up-button { display: none; }
    .modal-backdrop, .login-modal * { visibility: hidden; }
    
    • HTML
    <script>
    // Minified https://cdnjs.com/libraries/arrive
    var Arrive=function(e,t,n){"use stric...
    </script>
    
    <script>
        $(document).ready(function() {
            $(document).arrive('.login-modal', function() {
                $('.login-modal button.oauth2_basic').click();
            });
        });
    </script>
    

In a nutshell, I allow local logins but hides the sign up button, and when the log in modal shows (wether it’s coming from a click on the log in button, the reply button…) the modal is hidden and it simulates a click on the OAuth2 login method.

You can throw stones at me until I figure out a cleaner, lower-level way to do this :slight_smile:

1 Like