{% load i18n %}

<h3>
  {% trans "You are logged in. Continuing..." %}
</h3>
<script type="text/javascript">
  function proceed() {
    if (window.opener?.onLogin) {
      // We are in the normal process login
      window.opener.onLogin()
      window.close()
    } else {
      // we may be in login process that includes a magic link, so user
      // has opened a new window from this link, and we cannot close it then.
      window.location.href = '{% url "user_dashboard" %}'
    }
  }

  proceed()
// To handle errors, this template should be integrated into your authentication error message page
// Note that you can call any window.opener function like window.opener.func

</script>
