Fix all NextAuth v4 imports across codebase
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
'use server'
|
||||
|
||||
import { prisma } from './db'
|
||||
import { auth } from '@/auth'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { authOptions } from '@/pages/api/auth/[...nextauth]'
|
||||
|
||||
/**
|
||||
* Migration utilities for transitioning existing anonymous lists to user-owned lists
|
||||
@@ -71,7 +72,7 @@ export async function getClaimableLists(listIds: string[]): Promise<ClaimableLis
|
||||
export async function claimLists(listIds: string[]): Promise<MigrationResult> {
|
||||
try {
|
||||
// Get current user session
|
||||
const session = await auth()
|
||||
const session = await getServerSession(authOptions)
|
||||
if (!session?.user?.id) {
|
||||
return { success: false, error: 'Unauthorized: Please log in to claim lists' }
|
||||
}
|
||||
@@ -116,7 +117,7 @@ export async function claimLists(listIds: string[]): Promise<MigrationResult> {
|
||||
*/
|
||||
export async function hasExistingLists(): Promise<boolean> {
|
||||
try {
|
||||
const session = await auth()
|
||||
const session = await getServerSession(authOptions)
|
||||
if (!session?.user?.id) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user