fix: duplication error

This commit is contained in:
Michael Freno
2026-01-21 12:57:58 -05:00
parent 58d48dac70
commit 7b60494d6d
6 changed files with 11 additions and 12 deletions

2
.gitignore vendored
View File

@@ -19,7 +19,7 @@ app.config.timestamp_*.js
.classpath
*.launch
.settings/
#tasks
tasks
# Temp
gitignore

View File

@@ -8,14 +8,14 @@ export interface PostLike {
post_id: string;
}
export interface SessionDependantLikeProps {
export interface AuthenticatedLikeProps {
currentUserID: string | undefined | null;
isAuthenticated: boolean;
likes: PostLike[];
projectID: number;
}
export default function SessionDependantLike(props: SessionDependantLikeProps) {
export default function AuthenticatedLike(props: AuthenticatedLikeProps) {
const [hovering, setHovering] = createSignal(false);
const [likes, setLikes] = createSignal(props.likes);
const [instantOffset, setInstantOffset] = createSignal(0);

View File

@@ -9,7 +9,7 @@ import {
import { PageHead } from "~/components/PageHead";
import { createAsync } from "@solidjs/router";
import { getRequestEvent } from "solid-js/web";
import SessionDependantLike from "~/components/blog/SessionDependantLike";
import AuthenticatedLike from "~/components/blog/AuthenticatedLike";
import CommentIcon from "~/components/icons/CommentIcon";
import { Fire } from "~/components/icons/Fire";
import CommentSectionWrapper from "~/components/blog/CommentSectionWrapper";
@@ -433,11 +433,11 @@ export default function PostPage() {
</a>
<div>
<SessionDependantLike
currentUserID={postData.userID}
isAuthenticated={postData.isAuthenticated}
likes={postData.likes as any[]}
projectID={p().id}
<AuthenticatedLike
currentUserID={userID}
isAuthenticated={isAuthenticated}
likes={post.likes}
projectID={post.id}
/>
</div>
</div>

View File

@@ -160,7 +160,7 @@ const routerSections: RouterSection[] = [
router: "auth",
procedure: "signOut",
method: "mutation",
description: "Clear auth cookies and sign out"
description: "Clear auth cookie and sign out"
},
{
name: "GitHub Callback",

View File

@@ -1188,7 +1188,7 @@ export const authRouter = createTRPCRouter({
const secret = new TextEncoder().encode(env.JWT_SECRET_KEY);
const token = await new SignJWT({
email,
rememberMe: rememberMe ?? false, // Default to browser session cookie
rememberMe: rememberMe ?? false, // Default to browser cookie
code: loginCode
})
.setProtectedHeader({ alg: "HS256" })

View File

@@ -1,4 +1,3 @@
import { jwtVerify } from "jose";
import { SignJWT, jwtVerify } from "jose";
import { env } from "~/env/server";