mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 11:12:11 +01:00
- Add package.json with dependencies and scripts for Next.js and Prisma - Implement API routes for session management, user authentication, and company configuration - Create database schema for Company, User, and Session models in Prisma - Set up authentication with NextAuth and JWT - Add password reset functionality and user registration endpoint - Configure Tailwind CSS and PostCSS for styling - Implement metrics and dashboard settings API endpoints
10 lines
326 B
TypeScript
10 lines
326 B
TypeScript
import { getServerSession } from 'next-auth';
|
|
import { redirect } from 'next/navigation';
|
|
import { authOptions } from '../pages/api/auth/[...nextauth]';
|
|
|
|
export default async function HomePage() {
|
|
const session = await getServerSession(authOptions);
|
|
if (session?.user) redirect('/dashboard');
|
|
else redirect('/login');
|
|
}
|