nuxt-auth-utils 0.5.24 → 0.5.25
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 +1 -1
- package/dist/module.mjs +13 -9
- package/dist/runtime/app/components/AuthState.vue.d.ts +1 -1
- package/dist/runtime/app/plugins/session.client.d.ts +1 -1
- package/dist/runtime/app/plugins/session.server.d.ts +1 -1
- package/dist/runtime/server/lib/oauth/auth0.js +11 -0
- package/package.json +9 -9
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -84,15 +84,19 @@ const module = defineNuxtModule({
|
|
|
84
84
|
scrypt: options.hash?.scrypt
|
|
85
85
|
});
|
|
86
86
|
if (nuxt.options.dev && !process.env[envSessionPassword]) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
if (nuxt.options.runtimeConfig.session.password) {
|
|
88
|
+
process.env[envSessionPassword] = nuxt.options.runtimeConfig.session.password;
|
|
89
|
+
} else {
|
|
90
|
+
const password = process.env[envSessionPassword] = randomUUID().replace(/-/g, "");
|
|
91
|
+
const envPath = join(nuxt.options.rootDir, ".env");
|
|
92
|
+
const envContent = await readFile(envPath, "utf-8").catch(() => "");
|
|
93
|
+
if (!envContent.includes(envSessionPassword)) {
|
|
94
|
+
await writeFile(
|
|
95
|
+
envPath,
|
|
96
|
+
`${envContent ? envContent + "\n" : envContent}${envSessionPassword}=${password}`,
|
|
97
|
+
"utf-8"
|
|
98
|
+
);
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
runtimeConfig.public.auth = defu(runtimeConfig.public.auth, {
|
|
@@ -9,7 +9,7 @@ type __VLS_Slots = {} & {
|
|
|
9
9
|
} & {
|
|
10
10
|
placeholder?: (props: typeof __VLS_3) => any;
|
|
11
11
|
};
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const __VLS_component: import("vue-demi").DefineComponent<{}, {}, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue-demi").ComponentProvideOptions, true, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
15
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
@@ -15,6 +15,17 @@ export function defineOAuthAuth0EventHandler({ config, onSuccess, onError }) {
|
|
|
15
15
|
const tokenURL = `https://${config.domain}/oauth/token`;
|
|
16
16
|
const query = getQuery(event);
|
|
17
17
|
const redirectURL = config.redirectURL || getOAuthRedirectURL(event);
|
|
18
|
+
if (query.error) {
|
|
19
|
+
return handleAccessTokenErrorResponse(
|
|
20
|
+
event,
|
|
21
|
+
"auth0",
|
|
22
|
+
{
|
|
23
|
+
error: query.error,
|
|
24
|
+
error_description: query.error_description
|
|
25
|
+
},
|
|
26
|
+
onError
|
|
27
|
+
);
|
|
28
|
+
}
|
|
18
29
|
if (!query.code) {
|
|
19
30
|
config.scope = config.scope || ["openid", "offline_access"];
|
|
20
31
|
if (config.emailRequired && !config.scope.includes("email")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-auth-utils",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.25",
|
|
4
4
|
"description": "Add Authentication to Nuxt applications with secured & sealed cookies sessions.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
11
|
-
"packageManager": "pnpm@10.
|
|
11
|
+
"packageManager": "pnpm@10.16.1",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/types.d.mts",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@adonisjs/hash": "^9.1.1",
|
|
43
|
-
"@nuxt/kit": "^4.1.
|
|
43
|
+
"@nuxt/kit": "^4.1.2",
|
|
44
44
|
"defu": "^6.1.4",
|
|
45
45
|
"h3": "^1.15.4",
|
|
46
46
|
"hookable": "^5.5.3",
|
|
47
47
|
"jose": "^6.1.0",
|
|
48
48
|
"ofetch": "^1.4.1",
|
|
49
|
-
"openid-client": "^6.
|
|
49
|
+
"openid-client": "^6.8.0",
|
|
50
50
|
"pathe": "^2.0.3",
|
|
51
51
|
"scule": "^1.3.0",
|
|
52
52
|
"uncrypto": "^0.1.3"
|
|
@@ -72,20 +72,20 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
75
|
+
"@iconify-json/simple-icons": "^1.2.52",
|
|
76
76
|
"@nuxt/devtools": "2.6.3",
|
|
77
77
|
"@nuxt/eslint-config": "^1.9.0",
|
|
78
78
|
"@nuxt/module-builder": "^1.0.2",
|
|
79
|
-
"@nuxt/schema": "^4.1.
|
|
79
|
+
"@nuxt/schema": "^4.1.2",
|
|
80
80
|
"@nuxt/test-utils": "^3.19.2",
|
|
81
81
|
"@types/node": "latest",
|
|
82
82
|
"@nuxt/ui": "^4.0.0-alpha.1",
|
|
83
83
|
"@simplewebauthn/types": "^12.0.0",
|
|
84
84
|
"changelogen": "^0.6.2",
|
|
85
|
-
"eslint": "^9.
|
|
86
|
-
"nuxt": "^4.1.
|
|
85
|
+
"eslint": "^9.35.0",
|
|
86
|
+
"nuxt": "^4.1.2",
|
|
87
87
|
"typescript": "5.9.2",
|
|
88
88
|
"vitest": "^3.2.4",
|
|
89
|
-
"vue-tsc": "^3.0.
|
|
89
|
+
"vue-tsc": "^3.0.7"
|
|
90
90
|
}
|
|
91
91
|
}
|