- Implemented WriteReviewPage for users to submit reviews with ratings and playtime. - Created global CSS styles for consistent theming across the application. - Established RootLayout for metadata and global styles. - Developed LoginPage for user authentication with email/password and Steam login options. - Built Home page to display game search results and recent reviews. - Added LinkSteamPage for linking Steam accounts to user profiles. - Created ProfilePage to manage user information and display their reviews. - Developed GameCard and ReviewCard components for displaying games and reviews. - Implemented Header component for navigation and user session management. - Added Providers component to wrap the application with session context. - Integrated NextAuth for user authentication with Steam and credentials. - Set up Prisma client for database interactions. - Created Steam API utility functions for fetching game and user data. - Configured TypeScript settings for the project.
23 lines
526 B
TypeScript
23 lines
526 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { auth } from '@/lib/auth'
|
|
import { prisma } from '@/lib/db'
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const session = await auth()
|
|
|
|
if (!session?.user?.id) {
|
|
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
}
|
|
|
|
await prisma.user.update({
|
|
where: { id: session.user.id },
|
|
data: {
|
|
steamId: null,
|
|
steamPersonaname: null,
|
|
steamAvatar: null
|
|
}
|
|
})
|
|
|
|
return NextResponse.json({ success: true })
|
|
}
|