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
* Fix bug where new session wasn't saved correctly after authenticating via refresh token
* Refactored API to improve DX
* Fix sign out method
* Addressed feedback
* Refactor the API surface area
* Use more strict typing in loader to support type inference
* README updates
* Ensure consistent return type for unauthorized data
* Revert exports
---------
Co-authored-by: Chance Strickland <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+64-44Lines changed: 64 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ To use the `signOut` method, you'll need to set your app's homepage in your Work
40
40
Certain environment variables are optional and can be used to debug or configure cookie settings.
41
41
42
42
```sh
43
-
WORKOS_COOKIE_MAX_AGE='600'# maximum age of the cookie in seconds. Defaults to 31 days
43
+
WORKOS_COOKIE_MAX_AGE='600'# maximum age of the cookie in seconds. Defaults to 400 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
46
WORKOS_API_PORT=5173 # port to use for API calls
@@ -50,15 +50,15 @@ WORKOS_API_PORT=5173 # port to use for API calls
50
50
51
51
### Callback route
52
52
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:
53
+
AuthKit 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:
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`.
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:2884/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:
<p>Welcome back {user?.firstName&&`, ${user?.firstName}`}</p>
85
+
</div>
86
+
);
87
+
}
88
+
```
89
+
90
+
For pages where you want to display a signed-in and signed-out view, use `authkitLoader` to retrieve the user profile from WorkOS. You can pass in additional data by providing a loader function directly to `authkitLoader`.
0 commit comments