2024-10-27 21:11:45 +00:00
|
|
|
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
|
|
|
2024-12-07 22:59:36 +01:00
|
|
|
'use client';
|
|
|
|
|
2024-12-01 16:31:56 +01:00
|
|
|
import LoginForm from '@/app/ui/components/login-form';
|
2024-12-07 13:06:14 +01:00
|
|
|
import RegistrationForm from '@/app/ui/components/registration-form';
|
2024-12-07 22:59:36 +01:00
|
|
|
import { useParams } from 'next/navigation'
|
2024-12-08 09:31:31 +01:00
|
|
|
import { useEffect } from 'react';
|
|
|
|
import { retrieveCSRFToken } from '../api/authentication';
|
|
|
|
import { getCsrfToken } from '../lib/utils';
|
2024-08-11 12:03:11 +02:00
|
|
|
|
2024-12-07 22:59:36 +01:00
|
|
|
export default async function Page() {
|
|
|
|
const params = useParams<{ slug: string }>()
|
2024-12-08 09:31:31 +01:00
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (getCsrfToken() == 'unknown') {
|
|
|
|
retrieveCSRFToken();
|
|
|
|
}
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
localStorage.setItem('slug', await params.slug);
|
|
|
|
}
|
2024-12-01 18:02:25 +01:00
|
|
|
|
2024-08-11 12:03:11 +02:00
|
|
|
return (
|
|
|
|
<main className="flex min-h-screen flex-col p-6">
|
2024-12-01 16:31:56 +01:00
|
|
|
<div className="flex flex-row">
|
|
|
|
<div className="w-1/2">
|
|
|
|
Already have an account? Sign in
|
|
|
|
<LoginForm />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="w-1/2">
|
|
|
|
Don't have an account? Register now!
|
2024-12-07 13:06:14 +01:00
|
|
|
<RegistrationForm />
|
2024-12-01 16:31:56 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-08-11 12:03:11 +02:00
|
|
|
</main>
|
|
|
|
);
|
|
|
|
}
|