{% extends "ui/page.html" %}

{% load i18n static ui %}

{% block title %}{% translate 'Redirecting back to the extension...' %}{% endblock %}

{% block button_bar_class %}d-none{% endblock %}

{% block page_body %}
  <div class="container">
    <div class="alert alert-success mt-3" role="alert">
      <h4 class="alert-heading">{% translate 'Done!' %}</h4>
      <p class="lead mb-0">
        {% if app_redirect_url %}
          {% translate "You've successfully logged in to the application." %}
        {% else %}
          {% translate "You've successfully logged in to the extension." %}
        {% endif %}
      </p>
    </div>
  </div>
{% endblock %}

{% block page_scripts %}
{% if app_redirect_url %}
<script type="text/javascript">
(() => {
  window.setTimeout(
    () => {
      window.location.replace('{{ app_redirect_url|safe }}');
    },
    1000,
  );
})();
</script>
{% endif %}
{% endblock %}
