Skip to content

Commit 907380e

Browse files
author
Paul Asjes
committed
Update readme
1 parent 9312528 commit 907380e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ WORKOS_API_PORT=3000 # port to use for API calls
5050

5151
### Callback route
5252

53-
WorkOS requires that you have a callback URL to redirect users back to after they've authenticated. In your Remix app, [create a new route](https://remix.run/docs/en/main/discussion/routes), name it `callback.tsx` and add the following.
53+
WorkOS requires that you have a callback URL to redirect users back to after they've authenticated. In your Remix app, [create a new route](https://remix.run/docs/en/main/discussion/routes) and add the following:
5454

5555
```ts
5656
import { authLoader } from '@workos-inc/authkit-remix';
5757

5858
export const loader = authLoader();
5959
```
6060

61-
Make sure this route matches the `WORKOS_REDIRECT_URI` variable and the configured redirect URI in your WorkOS dashboard. For instance if your redirect URI is `http://localhost:3000/auth/callback` then you'd put the above code in `/app/routes/callback.ts`.
61+
Make sure this route matches the `WORKOS_REDIRECT_URI` variable and the configured redirect URI in your WorkOS dashboard. For instance if your redirect URI is `http://localhost:3000/callback` then you'd put the above code in `/app/routes/callback.ts`.
6262

6363
You can also control the pathname the user will be sent to after signing-in by passing a `returnPathname` option to `authLoader` like so:
6464

@@ -78,7 +78,14 @@ import { Link, useRouteLoaderData, json, Form } from '@remix-run/react';
7878
import { getSignInUrl, getSignUpUrl, withAuth, signOut } from '@workos-inc/authkit-remix';
7979

8080
export async function loader({ request }: LoaderFunctionArgs) {
81-
const { user } = await withAuth(request);
81+
const {
82+
user,
83+
sessionId,
84+
organizationId,
85+
role,
86+
impersonator,
87+
accessToken
88+
} = await withAuth(request);
8289

8390
return json({
8491
signInUrl: await getSignInUrl(),

0 commit comments

Comments
 (0)