@logto/remix 3.0.8 → 3.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
The Logto Remix SDK written in TypeScript.
|
|
8
8
|
|
|
9
|
+
> **Note:** This SDK has been migrated from Remix to React Router. For detailed migration guide, please refer to the [official React Router migration documentation](https://reactrouter.com/upgrading/remix).
|
|
10
|
+
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
11
13
|
**Note:** This package requires Node.js version 20 or higher.
|
|
@@ -33,7 +35,7 @@ pnpm add @logto/remix
|
|
|
33
35
|
Before initializing the SDK, we have to create a `SessionStorage` instance which takes care of the session persistence. In our case, we want to use a cookie-based session:
|
|
34
36
|
|
|
35
37
|
```ts
|
|
36
|
-
//
|
|
38
|
+
// services/auth.server.ts
|
|
37
39
|
import { createCookieSessionStorage } from '@remix-run/node';
|
|
38
40
|
import { makeLogtoRemix } from '@logto/remix';
|
|
39
41
|
|
|
@@ -65,7 +67,7 @@ The SDK ships with a convenient function that mounts the authentication routes:
|
|
|
65
67
|
```ts
|
|
66
68
|
// routes/api.logto.$action.ts
|
|
67
69
|
|
|
68
|
-
import { logto } from '../../
|
|
70
|
+
import { logto } from '../../services/auth.server';
|
|
69
71
|
|
|
70
72
|
export const loader = logto.handleAuthRoutes({
|
|
71
73
|
'sign-in': {
|
|
@@ -101,7 +103,7 @@ import type { LogtoContext } from '@logto/remix';
|
|
|
101
103
|
import { LoaderFunction, json } from '@remix-run/node';
|
|
102
104
|
import { useLoaderData } from '@remix-run/react';
|
|
103
105
|
|
|
104
|
-
import { logto } from '../../
|
|
106
|
+
import { logto } from '../../services/auth.server';
|
|
105
107
|
|
|
106
108
|
type LoaderResponse = {
|
|
107
109
|
readonly context: LogtoContext;
|
|
@@ -22,7 +22,7 @@ class HandleSignInCallbackController {
|
|
|
22
22
|
// is present, we will replace `http` with `https` in the `callbackUri`.
|
|
23
23
|
const isForwardedHttpsTraffic = request.headers.get('x-forwarded-proto') === 'https';
|
|
24
24
|
const callbackUri = isForwardedHttpsTraffic
|
|
25
|
-
? request.url.replace('http', 'https')
|
|
25
|
+
? request.url.replace('http://', 'https://')
|
|
26
26
|
: request.url;
|
|
27
27
|
const result = await this.useCase({
|
|
28
28
|
cookieHeader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/remix",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"directory": "packages/remix"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@logto/node": "^3.1.
|
|
22
|
+
"@logto/node": "^3.1.6"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@remix-run/node": "^2.0.0",
|