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