fix: duplication error
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,7 +19,7 @@ app.config.timestamp_*.js
|
||||
.classpath
|
||||
*.launch
|
||||
.settings/
|
||||
#tasks
|
||||
tasks
|
||||
|
||||
# Temp
|
||||
gitignore
|
||||
|
||||
@@ -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);
|
||||
@@ -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>
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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" })
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { jwtVerify } from "jose";
|
||||
import { SignJWT, jwtVerify } from "jose";
|
||||
import { env } from "~/env/server";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user