fix: login callback

This commit is contained in:
Ou 2024-11-03 21:13:21 +08:00
parent 1e88d8c1a9
commit 62afb8546d

View File

@ -22,6 +22,13 @@
if (theme === "auto" ? isDark : theme === "dark") {
document.documentElement.classList.add("dark")
}
const query = new URLSearchParams(window.location.search)
if (query.has("login") && query.has("user") && query.has("jwt")) {
localStorage.setItem("user", query.get("user"))
localStorage.setItem("jwt", JSON.stringify(query.get("jwt")))
window.history.replaceState({}, document.title, window.location.pathname)
}
</script>
<title>NewsNow</title>
</head>