@logto/remix 1.0.0-beta.13 → 1.0.0-beta.14
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 +2 -2
- package/lib/module.d.mts +29 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ A typical use case is to fetch the _authentication context_ which contains infor
|
|
|
97
97
|
|
|
98
98
|
```ts
|
|
99
99
|
// app/routes/index.tsx
|
|
100
|
-
import type { LogtoContext } from "@
|
|
100
|
+
import type { LogtoContext } from "@logto/remix";
|
|
101
101
|
import { LoaderFunction, json } from "@remix-run/node";
|
|
102
102
|
import { useLoaderData } from "@remix-run/react";
|
|
103
103
|
|
|
@@ -108,7 +108,7 @@ type LoaderResponse = {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
export const loader: LoaderFunction = async ({ request }) => {
|
|
111
|
-
const context = await logto.getContext({
|
|
111
|
+
const context = await logto.getContext({ getAccessToken: false })(
|
|
112
112
|
request
|
|
113
113
|
);
|
|
114
114
|
|
package/lib/module.d.mts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GetContextParameters, LogtoConfig } from "@logto/node";
|
|
2
|
+
import { SessionStorage } from "@remix-run/node";
|
|
3
|
+
export { type LogtoConfig } from '@logto/node';
|
|
4
|
+
export { type LogtoContext } from '@logto/node';
|
|
5
|
+
type Config = Readonly<LogtoConfig> & {
|
|
6
|
+
readonly baseUrl: string;
|
|
7
|
+
};
|
|
8
|
+
export const makeLogtoRemix: (config: Config, deps: {
|
|
9
|
+
sessionStorage: SessionStorage;
|
|
10
|
+
}) => Readonly<{
|
|
11
|
+
handleAuthRoutes: (dto: {
|
|
12
|
+
"sign-in": {
|
|
13
|
+
readonly path: string;
|
|
14
|
+
readonly redirectBackTo: string;
|
|
15
|
+
};
|
|
16
|
+
"sign-in-callback": {
|
|
17
|
+
readonly path: string;
|
|
18
|
+
readonly redirectBackTo: string;
|
|
19
|
+
};
|
|
20
|
+
"sign-out": {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly redirectBackTo: string;
|
|
23
|
+
};
|
|
24
|
+
}) => import("@remix-run/node").LoaderFunction;
|
|
25
|
+
getContext: (dto: GetContextParameters) => (request: Request) => Promise<import("@logto/node").LogtoContext>;
|
|
26
|
+
}>;
|
|
27
|
+
export { type LogtoContext } from '@logto/node';
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/remix",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"source": "./src/index.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dev:tsc": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
|
|
23
23
|
"precommit": "lint-staged",
|
|
24
24
|
"check": "tsc --noEmit",
|
|
25
|
-
"build": "rm -rf lib/ && pnpm check && parcel build",
|
|
25
|
+
"build": "rm -rf lib/ && pnpm check && parcel build && cp lib/index.d.ts lib/module.d.mts",
|
|
26
26
|
"lint": "eslint --ext .ts src",
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"test:coverage": "jest --silent --coverage",
|
|
29
29
|
"prepack": "pnpm test"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@logto/node": "^1.0.0-beta.
|
|
32
|
+
"@logto/node": "^1.0.0-beta.14"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@commitlint/cli": "^17.1.2",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "2b391f477b116a1adbf100696d7bf32c25f019e9"
|
|
80
80
|
}
|