@logto/nuxt 1.1.4 → 1.1.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
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { useState, useNuxtApp } from "#app";
|
|
2
|
+
import { shallowRef } from "vue";
|
|
1
3
|
import { LogtoStateKey } from "../utils/constants.js";
|
|
2
|
-
import { shallowRef as shallowReference, useNuxtApp, useState } from "#imports";
|
|
3
4
|
export default function useLogtoUser() {
|
|
4
5
|
const nuxtApp = useNuxtApp();
|
|
5
6
|
const user = useState(
|
|
6
7
|
LogtoStateKey.User,
|
|
7
|
-
() =>
|
|
8
|
+
() => shallowRef(nuxtApp.ssrContext?.event.context.logtoUser)
|
|
8
9
|
);
|
|
9
10
|
return user.value;
|
|
10
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import LogtoClient, { CookieStorage } from "@logto/node";
|
|
2
2
|
import { trySafe } from "@silverhand/essentials";
|
|
3
3
|
import { defineEventHandler, getRequestURL, getCookie, setCookie, sendRedirect } from "h3";
|
|
4
|
-
import { defaults } from "../utils/constants.js";
|
|
5
4
|
import { useRuntimeConfig } from "#imports";
|
|
5
|
+
import { defaults } from "../utils/constants.js";
|
|
6
6
|
export default defineEventHandler(async (event) => {
|
|
7
7
|
const config = useRuntimeConfig(event);
|
|
8
8
|
const logtoConfig = config.logto;
|
|
@@ -32,8 +32,8 @@ export default defineEventHandler(async (event) => {
|
|
|
32
32
|
cookieKey: cookieName,
|
|
33
33
|
encryptionKey: cookieEncryptionKey,
|
|
34
34
|
isSecure: cookieSecure,
|
|
35
|
-
getCookie: (name) => getCookie(event, name),
|
|
36
|
-
setCookie: (name, value, options) => {
|
|
35
|
+
getCookie: async (name) => getCookie(event, name),
|
|
36
|
+
setCookie: async (name, value, options) => {
|
|
37
37
|
setCookie(event, name, value, options);
|
|
38
38
|
}
|
|
39
39
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/nuxt",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@nuxt/kit": "^3.10.2",
|
|
46
46
|
"@silverhand/essentials": "^2.9.2",
|
|
47
47
|
"defu": "^6.1.4",
|
|
48
|
-
"@logto/node": "^3.0
|
|
48
|
+
"@logto/node": "^3.1.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"precommit": "lint-staged",
|