From aa355e03fdcb0b19249ad332949ba5a670cdb4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Tue, 3 Jun 2025 11:42:30 +0800 Subject: [PATCH] Made validateUserToken avaible via get requests & updated the system so that it now has a privacy policy & terms of service (TOS) And added a add email & display current email logic. --- components/app/windows/settings.vue | 108 ++++++++++++++++-- i18n/locales/en.json | 4 +- i18n/locales/zh-tw.json | 4 +- ...UserToken.post.ts => validateUserToken.ts} | 3 +- 4 files changed, 103 insertions(+), 16 deletions(-) rename server/api/user/{validateUserToken.post.ts => validateUserToken.ts} (93%) diff --git a/components/app/windows/settings.vue b/components/app/windows/settings.vue index d2470aa..8a9369c 100644 --- a/components/app/windows/settings.vue +++ b/components/app/windows/settings.vue @@ -2,12 +2,19 @@ import { BadgeCheckIcon, OctagonAlertIcon } from "lucide-vue-next"; import { Input } from "~/components/ui/input"; const { t, locale } = useI18n(); -const user = ref(); +const user = ref(""); +const enterFirstName = ref(); +const useremail = ref(); +const enteruseremail = ref(); onMounted(async () => { const req = await fetch("/api/user/validateUserToken"); const res = await req.json(); - user.value = res; + user.value = res.firstName; + useremail.value = res; }); +const setFirstName = async () => { + const staticFirstName = ""; +}; const logoutAction = () => {}; const groqApiKeyRegex = /^gsk_[a-zA-Z0-9]{52}$/; @@ -68,15 +75,77 @@ const confirmLogout = async () => { showLogoutDialog.value = false; }; const deleteAccount = async () => { - const req = await fetch("/api/user/delete", { + const req = await fetch("/api/user/action", { method: "DELETE", }); }; +/** + * + * userAccount: fetchViaSQL[0].username, + requested_action: "CONTINUE", + email: fetchViaSQL[0].email, + avatarURL: fetchViaSQL[0].avatarurl, + firstName: fetchViaSQL[0].firstName, + */