fixed aeskeyshare
This commit is contained in:
parent
a904885023
commit
780c614263
2
main.go
2
main.go
|
@ -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) {
|
||||
|
|
|
@ -8,10 +8,22 @@ window.addEventListener("message", function(event) {
|
|||
access_token: access_token
|
||||
})
|
||||
})
|
||||
.then((response) => function () {
|
||||
if (response.status === 200) {
|
||||
console.log("Key is valid")
|
||||
window.postMessage(localStorage.getItem("DONOTSHARE-password"), event.origin)
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
async function doStuff() {
|
||||
let responseData = await response.json()
|
||||
if (response.status === 200) {
|
||||
console.log("Key is valid")
|
||||
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!")
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
|
Reference in New Issue