initial version of the app
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import { getSession } from '@/lib/session';
|
||||
|
||||
export default async function HomePage() {
|
||||
const session = await getSession();
|
||||
|
||||
if (session) {
|
||||
if (session.role === 'admin') {
|
||||
redirect('/admin');
|
||||
} else {
|
||||
redirect('/dashboard');
|
||||
}
|
||||
} else {
|
||||
redirect('/login');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user