Skip to content

Commit 4bab7b7

Browse files
authored
Update README (#29)
1 parent 32d5bcd commit 4bab7b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,17 @@ Use `authkitLoader` to configure AuthKit for your Remix application routes.
7474

7575
```tsx
7676
import type { LoaderFunctionArgs } from '@remix-run/node';
77+
import { useLoaderData } from '@remix-run/react';
7778
import { authkitLoader } from '@workos-inc/authkit-remix';
7879

7980
export const loader = (args: LoaderFunctionArgs) => authkitLoader(args);
8081

8182
export function App() {
83+
84+
// Retrieves the user from the session or returns `null` if no user is signed in
85+
// Other supported values include sessionId, accessToken, organizationId, role, permissions and impersonator
86+
const { user, signInUrl, signUpUrl } = useLoaderData<typeof loader>();
87+
8288
return (
8389
<div>
8490
<p>Welcome back {user?.firstName && `, ${user?.firstName}`}</p>
@@ -108,8 +114,7 @@ export async function action({ request }: ActionFunctionArgs) {
108114
}
109115

110116
export default function HomePage() {
111-
// Retrieves the user from the session or returns `null` if no user is signed in
112-
// Other supported values include sessionId, accessToken, organizationId, role, permissions and impersonator
117+
113118
const { user, signInUrl, signUpUrl } = useLoaderData<typeof loader>();
114119

115120
if (!user) {

0 commit comments

Comments
 (0)