Refactor & clean up code.
This commit is contained in:
@@ -11,21 +11,14 @@ const AuthSuccessPage = () => {
|
||||
|
||||
useEffect(() => {
|
||||
const handleAuthSuccess = async () => {
|
||||
// Refresh the auth context to pick up the new session
|
||||
await refreshUser();
|
||||
|
||||
// Small delay to ensure state is updated
|
||||
setTimeout(() => {
|
||||
router.push('/');
|
||||
}, 100);
|
||||
setTimeout(() => router.push('/'), 100);
|
||||
};
|
||||
|
||||
handleAuthSuccess().catch((error) => {
|
||||
console.error(`Error: ${error instanceof Error ? error.message : error}`);
|
||||
});
|
||||
handleAuthSuccess()
|
||||
.catch(error => console.error(`Error handling auth success: ${error}`));
|
||||
}, [refreshUser, router]);
|
||||
|
||||
// Show loading while processing
|
||||
return (
|
||||
<div className='flex items-center justify-center min-h-screen'>
|
||||
<div className='flex flex-col items-center space-y-4'>
|
||||
|
14
src/app/(auth)/forgot-password/layout.tsx
Normal file
14
src/app/(auth)/forgot-password/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
export const generateMetadata = (): Metadata => {
|
||||
return {
|
||||
title: 'Forgot Password',
|
||||
};
|
||||
};
|
||||
|
||||
const ForgotPasswordLayout = ({
|
||||
children,
|
||||
}: Readonly<{ children: React.ReactNode }>) => {
|
||||
return <>{children}</>;
|
||||
};
|
||||
export default ForgotPasswordLayout;
|
11
src/app/(auth)/forgot-password/page.tsx
Normal file
11
src/app/(auth)/forgot-password/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
'use client';
|
||||
import { ForgotPasswordCard } from '@/components/default/auth/cards/client';
|
||||
|
||||
const ForgotPasswordPage = () => {
|
||||
return (
|
||||
<div className='flex flex-col items-center min-h-[50vh]'>
|
||||
<ForgotPasswordCard cardProps={{className: 'my-auto'}}/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default ForgotPasswordPage;
|
14
src/app/(auth)/profile/layout.tsx
Normal file
14
src/app/(auth)/profile/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
export const generateMetadata = (): Metadata => {
|
||||
return {
|
||||
title: 'Profile',
|
||||
};
|
||||
};
|
||||
|
||||
const ProfileLayout = ({
|
||||
children,
|
||||
}: Readonly<{ children: React.ReactNode }>) => {
|
||||
return <>{children}</>;
|
||||
};
|
||||
export default ProfileLayout;
|
9
src/app/(auth)/profile/page.tsx
Normal file
9
src/app/(auth)/profile/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
'use client';
|
||||
|
||||
const ProfilePage = () => {
|
||||
return (
|
||||
<div className='flex flex-col items-center min-h-[90vh]'>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default ProfilePage;
|
Reference in New Issue
Block a user