@logto/nuxt 1.2.3 → 1.2.5
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/dist/module.json +2 -2
- package/dist/runtime/composables/use-logto-client.d.ts +0 -20
- package/dist/runtime/composables/use-logto-user.d.ts +0 -19
- package/dist/runtime/server/event-handler.d.ts +0 -2
- package/dist/runtime/utils/constants.d.ts +0 -12
- package/dist/runtime/utils/handler.d.ts +0 -3
- package/dist/runtime/utils/types.d.ts +0 -98
- package/dist/types.d.mts +12 -2
- package/package.json +7 -9
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -11
- package/dist/types.d.ts +0 -7
package/dist/module.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type LogtoClient from '@logto/node';
|
|
2
|
-
/**
|
|
3
|
-
* Get the Logto client instance in the current context. Returns `undefined` if the client is not
|
|
4
|
-
* available.
|
|
5
|
-
*
|
|
6
|
-
* Note: This composable only works in the server side and relies on the SSR context which is
|
|
7
|
-
* filled by the Logto event handler.
|
|
8
|
-
*
|
|
9
|
-
* @returns The Logto client instance if available, otherwise `undefined`.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const client = useLogtoClient();
|
|
14
|
-
*
|
|
15
|
-
* if (client) {
|
|
16
|
-
* const token = await client.getAccessToken();
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export default function useLogtoClient(): LogtoClient | undefined;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the Logto user information. If the user is not signed in, this composable will return
|
|
3
|
-
* `undefined`.
|
|
4
|
-
*
|
|
5
|
-
* Note: This composable relies on the SSR context which is filled by the Logto event handler. Once
|
|
6
|
-
* the user is signed in, the user information will be available in both the server and client side.
|
|
7
|
-
*
|
|
8
|
-
* @returns The user information if the user is signed in, otherwise `undefined`.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const user = useLogtoUser();
|
|
13
|
-
*
|
|
14
|
-
* if (user) {
|
|
15
|
-
* console.log('User is signed in:', user); // { sub: '123', ... }
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export default function useLogtoUser(): any;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** The keys used to store the Logto state in `useState()`. */
|
|
2
|
-
export declare enum LogtoStateKey {
|
|
3
|
-
/** The key used to store the Logto user information. */
|
|
4
|
-
User = "logto.user"
|
|
5
|
-
}
|
|
6
|
-
/** The default Logto runtime configuration values that should be replaced with your own values. */
|
|
7
|
-
export declare const defaults: Readonly<{
|
|
8
|
-
readonly endpoint: "<replace-with-logto-endpoint>";
|
|
9
|
-
readonly appId: "<replace-with-logto-app-id>";
|
|
10
|
-
readonly appSecret: "<replace-with-logto-app-secret>";
|
|
11
|
-
readonly cookieEncryptionKey: "<replace-with-random-string>";
|
|
12
|
-
}>;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { LogtoConfig, SignInOptions } from '@logto/node';
|
|
2
|
-
type DeepPartial<T> = T extends Record<string, unknown> ? {
|
|
3
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
4
|
-
} : T;
|
|
5
|
-
type LogtoModuleOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* The name to use when storing the Logto cookie.
|
|
8
|
-
*
|
|
9
|
-
* @see {@link CookieConfig.cookieKey} for the default value.
|
|
10
|
-
*/
|
|
11
|
-
cookieName?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Whether the Logto cookie should be secure.
|
|
14
|
-
*
|
|
15
|
-
* Set this to `true` if you are using https.
|
|
16
|
-
*
|
|
17
|
-
* @see {@link CookieConfig.isSecure}
|
|
18
|
-
*/
|
|
19
|
-
cookieSecure?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* If Logto should fetch from the [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
|
|
22
|
-
* in the server side for the `event.context.logtoUser` property (used by `useLogtoUser` composable).
|
|
23
|
-
*
|
|
24
|
-
* This is useful when you need to fetch additional claims like `custom_data`.
|
|
25
|
-
*/
|
|
26
|
-
fetchUserInfo: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* The URI to redirect to after a successful sign-in callback.
|
|
29
|
-
*
|
|
30
|
-
* This is NOT the redirect URI used in Logto's configuration. This is the URI that the user will be
|
|
31
|
-
* redirected to after the sign-in callback is handled by the server.
|
|
32
|
-
*
|
|
33
|
-
* @default '/'
|
|
34
|
-
*/
|
|
35
|
-
postCallbackRedirectUri: string;
|
|
36
|
-
/**
|
|
37
|
-
* The URI to redirect to after a successful sign-out.
|
|
38
|
-
*
|
|
39
|
-
* This is the post sign-out redirect URI used in Logto's configuration.
|
|
40
|
-
*
|
|
41
|
-
* @default '/'
|
|
42
|
-
*/
|
|
43
|
-
postLogoutRedirectUri: string;
|
|
44
|
-
/**
|
|
45
|
-
* Pathnames for the sign-in, sign-out, and callback URIs. They will be handled by the Logto
|
|
46
|
-
* event handler.
|
|
47
|
-
*/
|
|
48
|
-
pathnames: {
|
|
49
|
-
/**
|
|
50
|
-
* The URI for initiating the sign-in process.
|
|
51
|
-
*
|
|
52
|
-
* @default '/sign-in'
|
|
53
|
-
*/
|
|
54
|
-
signIn: string;
|
|
55
|
-
/**
|
|
56
|
-
* The URI for initiating the sign-out process.
|
|
57
|
-
*
|
|
58
|
-
* @default '/sign-out'
|
|
59
|
-
*/
|
|
60
|
-
signOut: string;
|
|
61
|
-
/**
|
|
62
|
-
* The URI for handling the sign-in callback.
|
|
63
|
-
*
|
|
64
|
-
* @default '/callback'
|
|
65
|
-
*/
|
|
66
|
-
callback: string;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* The options for the sign-in process.
|
|
70
|
-
*
|
|
71
|
-
* @see https://docs.logto.io/docs/references/openid-connect/authentication-parameters
|
|
72
|
-
*/
|
|
73
|
-
signInOptions?: Omit<SignInOptions, 'redirectUri' | 'postRedirectUri'>;
|
|
74
|
-
};
|
|
75
|
-
/** The full runtime configuration for the Logto module. */
|
|
76
|
-
export type LogtoRuntimeConfig = LogtoModuleOptions & {
|
|
77
|
-
/**
|
|
78
|
-
* The secret used to encrypt the Logto cookie. It should be a random string.
|
|
79
|
-
*/
|
|
80
|
-
cookieEncryptionKey: string;
|
|
81
|
-
/**
|
|
82
|
-
* Custom base URL for redirects
|
|
83
|
-
*
|
|
84
|
-
* This URL is used as the base for generating redirect and callback URLs.
|
|
85
|
-
* It's particularly useful in environments where the application is behind
|
|
86
|
-
* a proxy or where URLs are rewritten.
|
|
87
|
-
*
|
|
88
|
-
* If set, this value will be used instead of the automatically detected URL.
|
|
89
|
-
* If not set, the system will use the URL obtained from `getRequestURL`.
|
|
90
|
-
*
|
|
91
|
-
* Example: 'https://your-public-facing-domain.com'
|
|
92
|
-
*
|
|
93
|
-
* Note: Provide only the base URL without paths or query parameters.
|
|
94
|
-
*/
|
|
95
|
-
customRedirectBaseUrl: string;
|
|
96
|
-
} & Omit<LogtoConfig, 'appSecret'> & Required<Pick<LogtoConfig, 'appSecret'>>;
|
|
97
|
-
export type LogtoRuntimeConfigInput = DeepPartial<LogtoRuntimeConfig>;
|
|
98
|
-
export {};
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { NuxtModule } from '@nuxt/schema'
|
|
2
2
|
|
|
3
|
-
import type { default as Module } from './module.
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
4
4
|
|
|
5
5
|
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
6
|
|
|
7
|
-
export { type LogtoNodeClient } from '
|
|
7
|
+
export { type LogtoNodeClient } from '@logto/node'
|
|
8
|
+
|
|
9
|
+
export { default } from './module.mjs'
|
|
10
|
+
|
|
11
|
+
export * from '../dist/runtime/utils/types.js'
|
|
12
|
+
|
|
13
|
+
export * from '@logto/node'
|
|
14
|
+
|
|
15
|
+
export * from '../dist/runtime/utils/constants.js'
|
|
16
|
+
|
|
17
|
+
export * from '../dist/runtime/utils/handler.js'
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/nuxt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"import": "./dist/module.mjs"
|
|
8
|
-
"types": "./dist/module.d.ts"
|
|
7
|
+
"import": "./dist/module.mjs"
|
|
9
8
|
}
|
|
10
9
|
},
|
|
11
|
-
"types": "./dist/module.d.ts",
|
|
12
10
|
"files": [
|
|
13
11
|
"dist"
|
|
14
12
|
],
|
|
@@ -19,8 +17,8 @@
|
|
|
19
17
|
"directory": "packages/nuxt"
|
|
20
18
|
},
|
|
21
19
|
"devDependencies": {
|
|
22
|
-
"@nuxt/module-builder": "^0.
|
|
23
|
-
"@nuxt/test-utils": "^3.
|
|
20
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
21
|
+
"@nuxt/test-utils": "^3.18.0",
|
|
24
22
|
"@silverhand/eslint-config": "^6.0.1",
|
|
25
23
|
"@vitest/coverage-v8": "^2.1.9",
|
|
26
24
|
"@vue/test-utils": "^2.4.4",
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
"h3": "^1.13.0",
|
|
29
27
|
"happy-dom": "^16.0.0",
|
|
30
28
|
"lint-staged": "^15.0.0",
|
|
31
|
-
"nuxt": "^3.
|
|
29
|
+
"nuxt": "^3.17.2",
|
|
32
30
|
"prettier": "^3.0.0",
|
|
33
31
|
"typescript": "^5.3.3",
|
|
34
32
|
"vitest": "^2.1.9",
|
|
@@ -42,10 +40,10 @@
|
|
|
42
40
|
"access": "public"
|
|
43
41
|
},
|
|
44
42
|
"dependencies": {
|
|
45
|
-
"@nuxt/kit": "^3.
|
|
43
|
+
"@nuxt/kit": "^3.17.2",
|
|
46
44
|
"@silverhand/essentials": "^2.9.2",
|
|
47
45
|
"defu": "^6.1.4",
|
|
48
|
-
"@logto/node": "^3.1.
|
|
46
|
+
"@logto/node": "^3.1.5"
|
|
49
47
|
},
|
|
50
48
|
"scripts": {
|
|
51
49
|
"precommit": "lint-staged",
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NuxtModule } from 'nuxt/schema';
|
|
2
|
-
import { LogtoRuntimeConfigInput } from '../dist/runtime/utils/types.js';
|
|
3
|
-
export * from '../dist/runtime/utils/types.js';
|
|
4
|
-
export * from '@logto/node';
|
|
5
|
-
export { default as LogtoNodeClient } from '@logto/node';
|
|
6
|
-
export * from '../dist/runtime/utils/constants.js';
|
|
7
|
-
export * from '../dist/runtime/utils/handler.js';
|
|
8
|
-
|
|
9
|
-
declare const logtoModule: NuxtModule<LogtoRuntimeConfigInput>;
|
|
10
|
-
|
|
11
|
-
export { logtoModule as default };
|
package/dist/types.d.ts
DELETED