mirror of
https://github.com/tale/headplane.git
synced 2026-08-19 09:26:18 +00:00
16 lines
420 B
TypeScript
16 lines
420 B
TypeScript
import { ActionFunctionArgs, redirect } from '@remix-run/node'
|
|
import { destroySession, getSession } from '~/utils/sessions'
|
|
|
|
export async function loader() {
|
|
return redirect('/machines')
|
|
}
|
|
|
|
export async function action({ request }: ActionFunctionArgs) {
|
|
const session = await getSession(request.headers.get('Cookie'))
|
|
return redirect('/login', {
|
|
headers: {
|
|
'Set-Cookie': await destroySession(session)
|
|
}
|
|
})
|
|
}
|