mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
16 lines
396 B
TypeScript
16 lines
396 B
TypeScript
import { redirect } from 'react-router';
|
|
|
|
import { getOptionalSession } from '@documenso/auth/server/lib/utils/get-session';
|
|
|
|
import type { Route } from './+types/_index';
|
|
|
|
export async function loader({ request }: Route.LoaderArgs) {
|
|
const { isAuthenticated } = await getOptionalSession(request);
|
|
|
|
if (isAuthenticated) {
|
|
throw redirect('/documents');
|
|
}
|
|
|
|
throw redirect('/signin');
|
|
}
|