Add user settings page

This commit is contained in:
2026-09-20 11:42:05 +01:00
parent fd0af3172d
commit 7910a578e6
8 changed files with 141 additions and 15 deletions
+27
View File
@@ -0,0 +1,27 @@
import userAuth from "@/src/functions/backend/auth/user-auth";
import grabUsers from "@/src/functions/backend/db/users/grab-users";
import type { PagePropsType } from "@/src/types";
import type { BunextPageServerFn } from "@moduletrace/bunext/types";
const server: BunextPageServerFn<PagePropsType> = async ({ req }) => {
const { user } = await userAuth({ req });
if (!user?.logged_in_status || !user.id) {
return {
redirect: {
destination: "/auth/login",
permanent: false,
},
};
}
const user_res = await grabUsers({ user_id: user.id });
return {
props: {
single_user: user_res.singleRes || null,
},
};
};
export default server;