Fix settings aka it does not do stuff when the user has logged in.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run

This commit is contained in:
yuanhau 2025-06-12 23:16:24 +08:00
parent 10e1354f27
commit 075e33d2af

View file

@ -27,6 +27,10 @@ const userData = ref({
}); });
const enteruseremail = ref(); const enteruseremail = ref();
onMounted(async () => { onMounted(async () => {
await validateUserInfo();
});
const validateUserInfo = async () => {
const req = await fetch("/api/user/validateUserToken"); const req = await fetch("/api/user/validateUserToken");
const res = await req.json(); const res = await req.json();
if (res.current_spot === "LOGOUT") { if (res.current_spot === "LOGOUT") {
@ -37,7 +41,7 @@ onMounted(async () => {
userData.value = res; userData.value = res;
useremail.value = res.email; useremail.value = res.email;
isLoggedIn.value = true; isLoggedIn.value = true;
}); };
const emit = defineEmits(["windowopener"]); const emit = defineEmits(["windowopener"]);
@ -166,6 +170,7 @@ const submitUserPassword = async () => {
success.value = true; success.value = true;
console.log(res); console.log(res);
userAccount.value = ""; userAccount.value = "";
await validateUserInfo();
} else { } else {
error.value = true; error.value = true;
errormsg.value = res.error; errormsg.value = res.error;