mirror of
https://github.com/DerTyp7/f1r3wave-website.git
synced 2025-10-29 21:17:09 +01:00
Removed next-auth and refactored authentication
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import ImageManager from '@/components/ImageManager';
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
import { ImagesResponse, TagsResponse } from '@/interfaces/api';
|
||||
import { getAuthStatus } from '@/lib/auth-utils';
|
||||
import { getSession } from '@/lib/session';
|
||||
import styles from '@/styles/AdminPage.module.scss';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default async function AdminPage() {
|
||||
const { isAuthenticated } = await getAuthStatus();
|
||||
const session = await getSession();
|
||||
|
||||
if (!isAuthenticated) {
|
||||
if (!session.isAuthenticated) {
|
||||
redirect('/login');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user