improving path handling, working on authorization flow

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2024-07-21 00:46:23 +02:00
parent 9ee963924d
commit 993c59bfa6
14 changed files with 278 additions and 100 deletions

View File

@@ -0,0 +1,12 @@
const UNAUTHORIZED = 401;
async function handleUser(response){
if (response.status == UNAUTHORIZED) {
window.location.href = 'login.html?return_to='+encodeURI(window.location.href);
return;
}
var user = await response.json();
// TODO: load navigation
}
fetch(api+"/user",{method:'POST'}).then(handleUser);