Add validate user & optimize code from coderabbit via PR #6
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 2025-06-13 19:37:07 +08:00
parent b862f4cdb0
commit ad0f13a1a2
3 changed files with 19 additions and 2 deletions

View file

@ -43,6 +43,11 @@ const validateUserInfo = async () => {
isLoggedIn.value = true;
};
const intervalTime = 1000 * 60 * 2; // Validate user Info for every ten min while the admin page is opened.
setInterval(async () => {
await validateUserInfo();
}, intervalTime);
const emit = defineEmits(["windowopener"]);
const logoutAction = async () => {
@ -96,6 +101,7 @@ const showDeleteDialog = ref(false);
const showLogoutDialog = ref(false);
const confirmDelete = async () => {
await deleteAccount();
await validateUserInfo();
showDeleteDialog.value = false;
};