Skip to content

Commit 9312528

Browse files
author
Paul Asjes
committed
Readme updates
1 parent 26dd273 commit 9312528

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

README.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,8 @@ export const loader = authLoader({ returnPathname: '/dashboard' });
7373
For pages where you want to display a signed-in and signed-out view, use `withAuth` to retrieve the user profile from WorkOS.
7474

7575
```jsx
76-
import type {
77-
ActionFunctionArgs,
78-
LoaderFunctionArgs,
79-
} from '@remix-run/node';
80-
import {
81-
Link,
82-
useRouteLoaderData,
83-
json,
84-
Form,
85-
} from '@remix-run/react';
76+
import type { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node';
77+
import { Link, useRouteLoaderData, json, Form } from '@remix-run/react';
8678
import { getSignInUrl, getSignUpUrl, withAuth, signOut } from '@workos-inc/authkit-remix';
8779

8880
export async function loader({ request }: LoaderFunctionArgs) {
@@ -106,8 +98,8 @@ export default function HomePage() {
10698
if (!user) {
10799
return (
108100
<>
109-
<Link href={signInUrl}>Log in</Link>
110-
<Link href={signUpUrl}>Sign Up</Link>
101+
<Link to={signInUrl}>Log in</Link>
102+
<Link to={signUpUrl}>Sign Up</Link>
111103
</>
112104
);
113105
}
@@ -126,7 +118,7 @@ export default function HomePage() {
126118
For pages where a signed-in user is mandatory, you can use the `ensureSignedIn` option:
127119
128120
```jsx
129-
const { user } = await withAuth({ ensureSignedIn: true });
121+
const { user } = await withAuth(request, { ensureSignedIn: true });
130122
```
131123
132124
Enabling `ensureSignedIn` will redirect users to AuthKit if they attempt to access the page without being authenticated.

0 commit comments

Comments
 (0)