(Theoretically) check for and refresh login tokens on page reload

merge-requests/8/head
knotteye 2020-06-26 04:40:06 -05:00
parent a9f1875234
commit 4fb1126c9f
1 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,15 @@
<link rel="stylesheet" type="text/css" href="/local.css">
<link rel="icon" type="image/svg" href="/logo.svg">
<title>{{ sitename }}</title>
<script>
//should check for and refresh login tokens on pageload..
if(document.cookie.match(/^(.*;)?\s*Authorization\s*=\s*[^;]+(.*)?$/) !== null) {
var xhr = new XMLHttpRequest();
xhr.open("POST", "/api/login", true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("");
}
</script>
{% block head %}
{% endblock %}
</head>