Created
January 13, 2023 04:59
-
-
Save dipeshhkc/23dc9840427e11f21cd587a8d640c3e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { LoaderFunction } from '@remix-run/server-runtime'; | |
import { redirect } from '@remix-run/server-runtime'; | |
import { getLoggedInUser } from '~/user.server'; | |
export const loader: LoaderFunction = async () => { | |
const user = await getLoggedInUser(); | |
if (!user) { | |
return redirect('/'); | |
} | |
return user; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment