You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add text (similar to PHP example) to rename `.env.example` to `.env`.
Change port from `:3000` to `:5173`. This is vite standard and default for new Remix apps.
Replace (unused) `useRouteLoaderData` with `useLoaderData`.
Remove unused variables from returned `withAuth` object to eleminate errors. (Left them as a comment).
Add `<br />` between `Sign in` and `Sign out` for visual separation.
Make sure the following values are present in your `.env.local` environment variables file. The client ID and API key can be found in the [WorkOS dashboard](https://dashboard.workos.com), and the redirect URI can also be configured there.
21
+
Rename the `.env.example` file to `.env` and ensure the following values are present in it. The client ID and API key can be found in the [WorkOS dashboard](https://dashboard.workos.com), and the redirect URI can also be configured there.
22
22
23
23
```sh
24
24
WORKOS_CLIENT_ID="client_..."# retrieved from the WorkOS dashboard
25
25
WORKOS_API_KEY="sk_test_..."# retrieved from the WorkOS dashboard
26
-
WORKOS_REDIRECT_URI="http://localhost:3000/callback"# configured in the WorkOS dashboard
26
+
WORKOS_REDIRECT_URI="http://localhost:5173/callback"# configured in the WorkOS dashboard
27
27
WORKOS_COOKIE_PASSWORD="<your password>"# generate a secure password here
28
28
```
29
29
@@ -43,7 +43,7 @@ Certain environment variables are optional and can be used to debug or configure
43
43
WORKOS_COOKIE_MAX_AGE='600'# maximum age of the cookie in seconds. Defaults to 31 days
44
44
WORKOS_API_HOSTNAME='api.workos.com'# base WorkOS API URL
45
45
WORKOS_API_HTTPS=true # whether to use HTTPS in API calls
46
-
WORKOS_API_PORT=3000# port to use for API calls
46
+
WORKOS_API_PORT=5173# port to use for API calls
47
47
```
48
48
49
49
## Setup
@@ -58,7 +58,7 @@ import { authLoader } from '@workos-inc/authkit-remix';
58
58
exportconst loader =authLoader();
59
59
```
60
60
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`.
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:5173/callback` then you'd put the above code in `/app/routes/callback.ts`.
62
62
63
63
You can also control the pathname the user will be sent to after signing-in by passing a `returnPathname` option to `authLoader` like so:
64
64
@@ -74,18 +74,12 @@ For pages where you want to display a signed-in and signed-out view, use `withAu
0 commit comments