This commit is contained in:
2025-04-30 05:01:03 +02:00
parent 4b8d7f1679
commit 7789bde384
10 changed files with 417 additions and 33 deletions

30
app/assets/js/login.js Normal file
View File

@@ -0,0 +1,30 @@
const loginchoice = document.querySelector("main > article.loginchoice")
function selectLoginType(type) {
for (const frame of loginchoice.children) {
frame.setAttribute("hidden", "")
if (frame.getAttribute("frame") == type) {
frame.removeAttribute("hidden")
}
}
if (type == "microsoft") {
system.call(`auth::${type}`)
}
}
system.result("auth::microsoft", () => {
selectLoginType("select")
})
system.result("auth::refresh", () => {
selectLoginType("select")
})
window.onload = () => {
if (localStorage.getItem("user")) {
system.call("auth::refresh", {
user: JSON.parse(localStorage.getItem("user"))
})
selectLoginType("token")
}
}