Logout button
This commit is contained in:
parent
aa94de4945
commit
31b7dc5bad
@ -5,11 +5,22 @@ const TPL_TOPBAR =
|
||||
`<div id="topbar">
|
||||
<div id="toolbar"></div>
|
||||
<div id="flowbar"></div>
|
||||
<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/">
|
||||
<div>powered</div>
|
||||
<div>by h5ai</div>
|
||||
<a id="backlink" href="https://iam.nexbyte.co.nz/realms/nexbyte/protocol/openid-connect/logout">
|
||||
<div id='username-display'>Loading...</div>
|
||||
<div>click to logout</div>
|
||||
</a>
|
||||
</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 =
|
||||
`<div id="mainrow">
|
||||
<div id="content"></div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user