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.
2024-04-29 21:18:46 +01:00
|
|
|
// Add an event listener to handle incoming messages
|
2024-04-29 01:45:22 +01:00
|
|
|
window.addEventListener("message", function(event) {
|
2024-04-29 21:18:46 +01:00
|
|
|
const access_token = event.data;
|
2024-04-29 01:45:22 +01:00
|
|
|
|
2024-04-29 21:28:18 +01:00
|
|
|
fetch("https://auth.hectabit.org/api/loggedin", {
|
2024-04-29 21:18:46 +01:00
|
|
|
method: "POST",
|
|
|
|
body: JSON.stringify({
|
|
|
|
access_token: access_token
|
2024-04-29 01:45:22 +01:00
|
|
|
})
|
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)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|