<!DOCTYPE html>
<html lang="en" dir="auto" data-color-mode="dark" data-light-theme="light" data-dark-theme="dark" class="loading">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0{{if not .config.Settings.UI.Zoom }}, maximum-scale=1.0, user-scalable=no{{end}}">
  <title>{{if and .config.SiteCaption .config.Sponsor }}{{ .config.SiteCaption }}{{else}}{{ .config.Name }}{{end}}</title>
    {{template "favicons.gohtml" .}}
  <link rel="stylesheet" href="{{ .config.CssUri }}">
  <link rel="manifest" href="{{ .config.ManifestUri }}" crossorigin="use-credentials">
</head>
<body class="{{ .config.Flags }} nojs">

{{template "app.gohtml" .}}

<script>{{ if eq .status "success" }}
  window.localStorage.setItem("session.id", {{ .session_id }});
  window.localStorage.setItem("session.token", {{ .access_token }});
  window.localStorage.setItem("session.provider", {{ .provider }});
  window.localStorage.setItem("session.user", JSON.stringify({{ .user }}));
  window.localStorage.removeItem("session.error");
  {{ else if eq .status "failed" }}
  window.localStorage.setItem("session.error", {{ .error }});
  {{ else }}
  window.localStorage.removeItem("session.id");
  window.localStorage.removeItem("session.token");
  window.localStorage.removeItem("session.provider");
  window.localStorage.removeItem("session.user");
  window.localStorage.removeItem("session.error");
  {{ end }}
  window.location.href = {{ .config.LoginUri }};
</script>
</body>
</html>
