-
Savage Tracking
-
Hi, {session?.data?.name} ({session?.data?.grade} {session?.data?.class})
+
+
+
+
+
+
Savage Tracking
+ Hi, {session?.data?.name} ({session?.data?.grade} {session?.data?.class})
+
+
+
+
+
+
+
+
+
+
+ {
+ session?.data?.isAdmin && (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+ )
+ }
-
-
-
-
-
-
-
-
-
- {
- session?.data?.isAdmin && (
- <>
-
-
-
-
-
-
-
-
-
- >
- )
- }
+
)
}
\ No newline at end of file
diff --git a/src/pages/dash.tsx b/src/pages/dash/index.tsx
similarity index 94%
rename from src/pages/dash.tsx
rename to src/pages/dash/index.tsx
index fe390f4..2e643c3 100644
--- a/src/pages/dash.tsx
+++ b/src/pages/dash/index.tsx
@@ -24,7 +24,7 @@ export default function Dash() {
-
+
>)
}
\ No newline at end of file
diff --git a/src/server/api/routers/admin.ts b/src/server/api/routers/admin.ts
index c3eb74e..b64ad76 100644
--- a/src/server/api/routers/admin.ts
+++ b/src/server/api/routers/admin.ts
@@ -17,16 +17,7 @@ export const adminRouter = createTRPCRouter({
}).then((user) => {
const result = compareSync(input.password, user?.password || "");
if (result) {
- console.log(user)
- console.log(PublicUserType.parse({
- grade: user?.grade,
- class: user?.class,
- name: user?.name,
- username: user?.username,
- isAdmin: user?.isAdmin,
- }))
const session = PublicUserType.parse(user)!;
- console.log(session)
const token = jwt.sign(session, process.env.JWT_SECRET || "", { expiresIn: "1d" });
ctx.res.setHeader("Set-Cookie", `token=${token}; Path=/; HttpOnly; SameSite=Strict; Max-Age=${60 * 60 * 24};`);
return {