mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-16 15:20:36 +08:00
update
This commit is contained in:
20
slient-renew.ts
Normal file
20
slient-renew.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useOidcStore } from "vue3-oidc";
|
||||
|
||||
const { state: oidcState } = useOidcStore();
|
||||
oidcState.value.userManager?.signinSilentCallback();
|
||||
|
||||
const LOGIN_REQUIRED = "login_required";
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const error = searchParams.get("error");
|
||||
const state = searchParams.get("state");
|
||||
const isLocalService = location.origin.includes(
|
||||
"://localhost" || "0.0.0.0" || "127.0.0.0"
|
||||
);
|
||||
|
||||
console.error(`Error: \n error: ${error} \n state: ${state}`);
|
||||
|
||||
if (error === LOGIN_REQUIRED && import.meta.env && !isLocalService) {
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
top?.location.reload();
|
||||
}
|
||||
Reference in New Issue
Block a user