Skip to content

Commit

Permalink
Update to Next.js 15 RC 2 (nextjs#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
leerob authored Oct 14, 2024
1 parent 5770d64 commit 507e1d8
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 346 deletions.
4 changes: 2 additions & 2 deletions app/(login)/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export async function signOut() {
const user = (await getUser()) as User;
const userWithTeam = await getUserWithTeam(user.id);
await logActivity(userWithTeam?.teamId, user.id, ActivityType.SIGN_OUT);
cookies().delete('session');
(await cookies()).delete('session');
}

const updatePasswordSchema = z
Expand Down Expand Up @@ -296,7 +296,7 @@ export const deleteAccount = validatedActionWithUser(
);
}

cookies().delete('session');
(await cookies()).delete('session');
redirect('/sign-in');
}
);
Expand Down
4 changes: 2 additions & 2 deletions lib/auth/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function verifyToken(input: string) {
}

export async function getSession() {
const session = cookies().get('session')?.value;
const session = (await cookies()).get('session')?.value;
if (!session) return null;
return await verifyToken(session);
}
Expand All @@ -50,7 +50,7 @@ export async function setSession(user: NewUser) {
expires: expiresInOneDay.toISOString(),
};
const encryptedSession = await signToken(session);
cookies().set('session', encryptedSession, {
(await cookies()).set('session', encryptedSession, {
expires: expiresInOneDay,
httpOnly: true,
secure: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/db/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cookies } from 'next/headers';
import { verifyToken } from '@/lib/auth/session';

export async function getUser() {
const sessionCookie = cookies().get('session');
const sessionCookie = (await cookies()).get('session');
if (!sessionCookie || !sessionCookie.value) {
return null;
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@radix-ui/react-slot": "^1.1.0",
"@types/bcryptjs": "^2.4.6",
"@types/node": "^22.5.5",
"@types/react": "^18.3.7",
"@types/react-dom": "^18.3.0",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"autoprefixer": "^10.4.20",
"bcryptjs": "^2.4.3",
"class-variance-authority": "^0.7.0",
Expand All @@ -32,11 +32,11 @@
"drizzle-orm": "^0.33.0",
"jose": "^5.9.2",
"lucide-react": "^0.441.0",
"next": "15.0.0-canary.152",
"next": "15.0.0-canary.190",
"postcss": "^8.4.47",
"postgres": "^3.4.4",
"react": "19.0.0-rc-7771d3a7-20240827",
"react-dom": "19.0.0-rc-7771d3a7-20240827",
"react": "19.0.0-rc-cd22717c-20241013",
"react-dom": "19.0.0-rc-cd22717c-20241013",
"server-only": "^0.0.1",
"stripe": "^16.12.0",
"tailwind-merge": "^2.5.2",
Expand All @@ -46,4 +46,4 @@
"typescript": "^5.6.2",
"zod": "^3.23.8"
}
}
}
Loading

0 comments on commit 507e1d8

Please sign in to comment.