Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions app/actions/verify.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use server";

import { cookies } from "next/headers";
import { nanoid } from "nanoid";
import { cookies } from "next/headers";

export async function getNonce() {
try {
const nonce = nanoid(32);
const cookieStore = await cookies();

cookies().set("siwe_nonce", nonce, {
await cookieStore.set("siwe_nonce", nonce, {
secure: true,
httpOnly: true,
sameSite: "strict",
Expand All @@ -23,7 +24,8 @@ export async function getNonce() {

export async function verifyNonceCookie(submittedNonce: string) {
try {
const storedNonce = cookies().get("siwe_nonce")?.value;
const cookieStore = await cookies();
const storedNonce = cookieStore.get("siwe_nonce")?.value;

if (!storedNonce) {
return { isValid: false, error: "No nonce found in cookies" };
Expand All @@ -32,7 +34,8 @@ export async function verifyNonceCookie(submittedNonce: string) {
const isValid = storedNonce === submittedNonce;

if (isValid) {
cookies().delete("siwe_nonce");
const cookieStore = await cookies();
await cookieStore.delete("siwe_nonce");
}

return { isValid };
Expand Down
2 changes: 1 addition & 1 deletion components/Poll/PollResultsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type VoteState = {
count: number;
};

export default function PollVoteCard({ pollId }: { pollId: number }) {
export default function PollResultsCard({ pollId }: { pollId: number }) {
const router = useRouter();
const { worldID } = useAuth();
const { handleShareResults, isOpen, setIsOpen, shareUrl } = useShare();
Expand Down
5 changes: 4 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
// Enable the React 19 compiler for optimizations
reactStrictMode: true,
};

export default nextConfig;
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "app-router-template",
"name": "worldview-fe",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -16,20 +16,20 @@
"date-fns": "^4.1.0",
"eruda": "^3.2.3",
"jwt-decode": "^4.0.0",
"next": "14.2.26",
"react": "^18",
"react-dom": "^18",
"next": "^15.3.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-hook-form": "^7.55.0",
"tailwind-merge": "^3.2.0",
"viem": "^2.26.0",
"zod": "^3.24.2"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/node": "^22.15.18",
"@types/react": "^19.1.4",
"@types/react-dom": "^19.1.5",
"eslint": "^8",
"eslint-config-next": "14.2.6",
"eslint-config-next": "^15.3.2",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
Expand Down
24 changes: 19 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -18,9 +22,19 @@
}
],
"paths": {
"@/*": ["./*"]
}
"@/*": [
"./*"
]
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading