This repository has been archived on 2024-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
burgerauth/static/js/aeskeyshare.js

17 lines
539 B
JavaScript
Raw Normal View History

2024-04-29 21:18:46 +01:00
// Add an event listener to handle incoming messages
window.addEventListener("message", function(event) {
2024-04-29 21:18:46 +01:00
const access_token = event.data;
2024-04-29 21:18:46 +01:00
fetch("https://auth.hectabit.org/api/isloggedin", {
method: "POST",
body: JSON.stringify({
access_token: access_token
})
2024-04-29 21:18:46 +01:00
})
.then((response) => function () {
if (response.status === 200) {
console.log("Key is valid")
window.postMessage(localStorage.getItem("DONOTSHARE-password"), event.origin)
}
})
});