fixed aeskeyshare

This commit is contained in:
Tracker-Friendly 2024-05-06 18:03:11 +01:00
parent a904885023
commit 780c614263
3 changed files with 19 additions and 6 deletions

View File

@ -739,7 +739,7 @@ func main() {
return
}
c.JSON(200, gin.H{"success": "true"})
c.JSON(200, gin.H{"appId": claims["aud"]})
})
router.GET("/api/auth", func(c *gin.Context) {

View File

@ -8,10 +8,22 @@ window.addEventListener("message", function(event) {
access_token: access_token
})
})
.then((response) => function () {
.then((response) => response)
.then((response) => {
async function doStuff() {
let responseData = await response.json()
if (response.status === 200) {
console.log("Key is valid")
window.postMessage(localStorage.getItem("DONOTSHARE-password"), event.origin)
let key = localStorage.getItem("DONOTSHARE-password").concat(responseData["appId"]);
for (let i = 0; i < 128; i++) {
key = await hashwasm.sha3(key)
}
parent.window.postMessage(key, "*")
}
console.log("Alive check!")
}
console.log("Running doStuff")
doStuff();
})
console.log("The script is running!")
});

View File

@ -6,6 +6,7 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="/static/svg/favicon.svg">
<script src="/static/js/hash-wasm.js"></script>
</head>
<p>Sending key...</p>
<script src="/static/js/aeskeyshare.js"></script>