Settings
Manage your instance settings
Profile Settings
Manage your profile settings
Password Settings
Manage your password
"use client"; import Sidebar from "@/components/Sidebar"; import { useState } from "react"; import axios from "axios"; import Cookies from "js-cookie"; interface DashboardPageProps { username: string; name: string; email: string; } export default function DashboardPage({ username, name, email }: DashboardPageProps) { const [profileUsername, setProfileUsername] = useState(username); const [profileName, setProfileName] = useState(name); const [profileEmail, setProfileEmail] = useState(email); const [password, setPassword] = useState(""); const [passwordConfirm, setPasswordConfirm] = useState(""); const saveProfile = async () => { const response = await axios.post("/api/user/change/profile", { token: Cookies.get("token"), username: profileUsername, name: profileName, email: profileEmail }); if (response.data.message !== "Profile updated successfully") { alert("Failed to update profile"); } } const savePassword = async () => { const response = await axios.post("/api/user/change/password", { token: Cookies.get("token"), old_password: password, password: passwordConfirm }); if (response.data.message !== "Password updated successfully") { alert("Failed to update password"); } } return (
Manage your instance settings
Manage your profile settings
Manage your password