feat: migrate from PocketBase to PostgreSQL with Drizzle ORM
- Add @project-e/db package with Drizzle schema and migrations - Replace PocketBase client with PostgreSQL-based database client - Migrate auth from custom to NextAuth.js - Add Docker Compose with PostgreSQL container - Update worker to use new database client - Remove PocketBase-specific files and migrations - Add drizzle config and initial migration
This commit is contained in:
@@ -2,7 +2,8 @@ import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
// Check if user is authenticated
|
||||
const token = request.cookies.get('pb_auth')?.value;
|
||||
const token = request.cookies.get('next-auth.session-token')?.value
|
||||
|| request.cookies.get('__Secure-next-auth.session-token')?.value;
|
||||
|
||||
// If no token and trying to access protected routes, redirect to login
|
||||
const protectedRoutes = [
|
||||
|
||||
Reference in New Issue
Block a user