From a84b053a1c38f3d5764ef21f536dfb95c923df9f Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 1 Feb 2026 16:46:21 -0700 Subject: [PATCH] Finish account page (3 more endpoints left then done with accounts on here) --- src/app/account/page.tsx | 43 ++++++++++++++++++++++++++++++++++------ src/util/cookie.ts | 7 +++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index c4f80dc..3ac6a30 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -2,9 +2,10 @@ import { HomeButton } from '@/app/components/HomeButton' import { DiscordButton } from '@/app/components/DiscordButton' -import { getCookie } from '@/util/cookie' +import { getCookie, unsetCookie } from '@/util/cookie' import { useEffect, useState } from 'react' import { useRouter } from 'next/navigation' +import Link from 'next/link' export default function AccountPage () { const [loading, setLoading] = useState(true) @@ -24,12 +25,42 @@ export default function AccountPage () {

- {loading - ? 'Loading...' - : 'Nothing on this page yet! You are logged in as ' + - getCookie('accountUsername', 'N/A') + - '.'} + {loading ? 'Loading...' : 'Account'}

+
+ + Change username + + + Change password + + + Refresh login + + +
) } diff --git a/src/util/cookie.ts b/src/util/cookie.ts index 480c5d3..1cee468 100644 --- a/src/util/cookie.ts +++ b/src/util/cookie.ts @@ -6,6 +6,13 @@ export function setCookie (name: string, value: string): void { document.cookie = cookie } +export function unsetCookie (name: string): void { + const cookie = `${encodeURIComponent( + name + )}=; Path=/; Max-Age=0; Secure; SameSite=Strict` + document.cookie = cookie +} + export function getCookie (name: string, defaultValue: string): string { const cookies = document.cookie.split('; ') for (const c of cookies) {