Test username retrieve
This commit is contained in:
parent
76e6209f9a
commit
2fb3caf548
19
assets/js/get_username.js
Normal file
19
assets/js/get_username.js
Normal file
@ -0,0 +1,19 @@
|
||||
async function getData() {
|
||||
const url = "https://login.ami.sc/";
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Response status: ${response.status}`);
|
||||
}
|
||||
|
||||
const user_name = response.headers.get("X-Authentik-Name");
|
||||
console.log(user_name);
|
||||
document.getElementById("username").innerHTML = user_name;
|
||||
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
getData();
|
@ -15,7 +15,8 @@
|
||||
</header>
|
||||
|
||||
<div class="link_box personal">
|
||||
<h2>🤵🏼 Personal</h2>
|
||||
<h2 id="username">Failed</h2>
|
||||
<script src="assets/js/get_username.js"></script>
|
||||
<a href="https://account.proton.me/login">
|
||||
<img src="assets/img/proton.svg">
|
||||
Proton
|
||||
|
Loading…
Reference in New Issue
Block a user