{% assign ready = false %}
{% if current_person.signed_in? %}
  {% for group in current_person.groups %}
    {% if group.id == "29ae12e6-f740-4190-a5c2-a7e12e87926f" or group.id == "aa36069f-e354-4dbe-9972-9ce70ad146d7" or group.id == "8cd6ec9c-101e-4b1a-82c7-77dac583a1f5"  %}
      {% assign ready = true %}
      {% break %}
    {% endif %}
  {% endfor %}
{% endif %}
{% if ready %}
    <script>
        var a = new URLSearchParams(window.location.search);
        window.location.replace(a.get('redirect_uri'));
    </script>
{% else %}
    <script>
        window.setTimeout(function() {
            window.location.reload(true);
        }, 3000);
    </script>
{% endif %}

<main>
    <img class="image" src="https://s3.amazonaws.com/static.northpass.com/Skuid/images/SkuidSkool-Hero3.png">
    <div class="text" style="background-color: #CEE8BE;">
        Please wait while we're configuring the school for you. 
        You’ll be automatically redirected when it's ready
    </div>
</main>

<style>
    main {
        height: 90vh;
        margin: auto;
    }
    .image {
        width: 90%;
        margin: 30px auto;
        display: flex;
    }
    .text {
        margin: 50px auto;
        font-size: 30px;
        text-align: center;
    }
</style>