Logout button

This commit is contained in:
admin 2026-08-08 20:17:34 +12:00
parent aa94de4945
commit 31b7dc5bad

View File

@ -5,11 +5,22 @@ const TPL_TOPBAR =
`<div id="topbar"> `<div id="topbar">
<div id="toolbar"></div> <div id="toolbar"></div>
<div id="flowbar"></div> <div id="flowbar"></div>
<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/"> <a id="backlink" href="https://iam.nexbyte.co.nz/realms/nexbyte/protocol/openid-connect/logout">
<div>powered</div> <div id='username-display'>Loading...</div>
<div>by h5ai</div> <div>click to logout</div>
</a> </a>
</div>`; </div>`;
fetch('/.api/get-username.php')
.then(response => response.json())
.then(data => {
document.getElementById('username-display').textContent = data.user;
})
.catch(error => {
console.error('Error fetching user:', error);
document.getElementById('username-display').textContent = 'User';
});
const TPL_MAINROW = const TPL_MAINROW =
`<div id="mainrow"> `<div id="mainrow">
<div id="content"></div> <div id="content"></div>