From 62afb8546df0d76d4d8cdb2e1d97034109438b6e Mon Sep 17 00:00:00 2001 From: Ou Date: Sun, 3 Nov 2024 21:13:21 +0800 Subject: [PATCH] fix: login callback --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index 6750562..0094823 100644 --- a/index.html +++ b/index.html @@ -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) + } NewsNow