mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
fix: login callback
This commit is contained in:
parent
1e88d8c1a9
commit
62afb8546d
@ -22,6 +22,13 @@
|
|||||||
if (theme === "auto" ? isDark : theme === "dark") {
|
if (theme === "auto" ? isDark : theme === "dark") {
|
||||||
document.documentElement.classList.add("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>
|
</script>
|
||||||
<title>NewsNow</title>
|
<title>NewsNow</title>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user