work-timer/app/routes/logout.tsx

13 lines
284 B
TypeScript
Raw Permalink Normal View History

2023-02-14 10:21:17 +01:00
import type { ActionArgs } from '@remix-run/node';
import { redirect } from '@remix-run/node';
2023-02-11 03:14:14 +01:00
2023-02-14 10:21:17 +01:00
import { logout } from '~/session.server';
2023-02-11 03:14:14 +01:00
export async function action({ request }: ActionArgs) {
2023-02-14 10:21:17 +01:00
return logout(request);
2023-02-11 03:14:14 +01:00
}
export async function loader() {
2023-02-14 10:21:17 +01:00
return redirect('/');
2023-02-11 03:14:14 +01:00
}