nuxt-users 1.15.1 → 1.15.3
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/CHANGELOG.md +39 -0
- package/dist/cli.mjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/server/utils/index.d.ts +2 -1
- package/dist/runtime/server/utils/index.js +2 -1
- package/dist/runtime/{composables → server/utils}/useNuxtUsersDatabase.d.ts +2 -2
- package/dist/runtime/{composables → server/utils}/useNuxtUsersDatabase.js +1 -1
- package/dist/runtime/{composables → server/utils}/useServerAuth.d.ts +2 -3
- package/dist/runtime/{composables → server/utils}/useServerAuth.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## v1.15.3
|
|
5
|
+
|
|
6
|
+
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.15.2...v1.15.3)
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
- Add export ([90ce9b0](https://github.com/rrd108/nuxt-users/commit/90ce9b0))
|
|
11
|
+
- Dynamic imports ([26ff073](https://github.com/rrd108/nuxt-users/commit/26ff073))
|
|
12
|
+
|
|
13
|
+
### 💅 Refactors
|
|
14
|
+
|
|
15
|
+
- Server utilities path ([f812135](https://github.com/rrd108/nuxt-users/commit/f812135))
|
|
16
|
+
|
|
17
|
+
### 🏡 Chore
|
|
18
|
+
|
|
19
|
+
- **release:** V1.15.2 ([67a71fb](https://github.com/rrd108/nuxt-users/commit/67a71fb))
|
|
20
|
+
|
|
21
|
+
### ❤️ Contributors
|
|
22
|
+
|
|
23
|
+
- Rrd108 ([@rrd108](https://github.com/rrd108))
|
|
24
|
+
|
|
25
|
+
## v1.15.2
|
|
26
|
+
|
|
27
|
+
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.15.1...v1.15.2)
|
|
28
|
+
|
|
29
|
+
### 🩹 Fixes
|
|
30
|
+
|
|
31
|
+
- Import path ([1d1013e](https://github.com/rrd108/nuxt-users/commit/1d1013e))
|
|
32
|
+
- Add export ([90ce9b0](https://github.com/rrd108/nuxt-users/commit/90ce9b0))
|
|
33
|
+
- Dynamic imports ([26ff073](https://github.com/rrd108/nuxt-users/commit/26ff073))
|
|
34
|
+
|
|
35
|
+
### 🏡 Chore
|
|
36
|
+
|
|
37
|
+
- **release:** V1.15.1 ([214661b](https://github.com/rrd108/nuxt-users/commit/214661b))
|
|
38
|
+
|
|
39
|
+
### ❤️ Contributors
|
|
40
|
+
|
|
41
|
+
- Rrd108 ([@rrd108](https://github.com/rrd108))
|
|
42
|
+
|
|
4
43
|
## v1.15.1
|
|
5
44
|
|
|
6
45
|
[compare changes](https://github.com/rrd108/nuxt-users/compare/v1.15.0...v1.15.1)
|
package/dist/cli.mjs
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addRouteMiddleware, addServerHandler, addComponent } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addServerImportsDir, addRouteMiddleware, addServerHandler, addComponent } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
export * from '../dist/runtime/server/utils/index.js';
|
|
4
4
|
|
|
@@ -94,6 +94,7 @@ const module = defineNuxtModule({
|
|
|
94
94
|
mode: "server"
|
|
95
95
|
});
|
|
96
96
|
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
97
|
+
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
97
98
|
addRouteMiddleware({
|
|
98
99
|
name: "authorization.client",
|
|
99
100
|
path: resolver.resolve("./runtime/middleware/authorization.client"),
|
|
@@ -5,4 +5,5 @@ export { createPersonalAccessTokensTable } from './create-personal-access-tokens
|
|
|
5
5
|
export { createPasswordResetTokensTable } from './create-password-reset-tokens-table.js';
|
|
6
6
|
export { createMigrationsTable } from './create-migrations-table.js';
|
|
7
7
|
export { runMigrations } from './migrate.js';
|
|
8
|
-
export { useNuxtUsersDatabase } from '
|
|
8
|
+
export { useNuxtUsersDatabase } from './useNuxtUsersDatabase.js';
|
|
9
|
+
export { useServerAuth } from './useServerAuth.js';
|
|
@@ -5,4 +5,5 @@ export { createPersonalAccessTokensTable } from "./create-personal-access-tokens
|
|
|
5
5
|
export { createPasswordResetTokensTable } from "./create-password-reset-tokens-table.js";
|
|
6
6
|
export { createMigrationsTable } from "./create-migrations-table.js";
|
|
7
7
|
export { runMigrations } from "./migrate.js";
|
|
8
|
-
export { useNuxtUsersDatabase } from "
|
|
8
|
+
export { useNuxtUsersDatabase } from "./useNuxtUsersDatabase.js";
|
|
9
|
+
export { useServerAuth } from "./useServerAuth.js";
|
|
@@ -8,8 +8,8 @@ export declare const useNuxtUsersDatabase: () => Promise<{
|
|
|
8
8
|
passwordResetTokens: string;
|
|
9
9
|
};
|
|
10
10
|
connector: {
|
|
11
|
-
name: import("
|
|
12
|
-
options: import("
|
|
11
|
+
name: import("../../../types.js").DatabaseType;
|
|
12
|
+
options: import("../../../types.js").DatabaseConfig;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const useNuxtUsersDatabase = async () => {
|
|
2
2
|
const { useRuntimeConfig } = await import("#imports");
|
|
3
|
-
const { useDb } = await import("
|
|
3
|
+
const { useDb } = await import("./db.js");
|
|
4
4
|
const { nuxtUsers } = useRuntimeConfig();
|
|
5
5
|
const options = nuxtUsers;
|
|
6
6
|
const database = await useDb(options);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { UserWithoutPassword } from '../../types.js';
|
|
1
|
+
import type { UserWithoutPassword } from '../../../types.js';
|
|
3
2
|
/**
|
|
4
3
|
* Server-side composable for authentication utilities
|
|
5
4
|
*
|
|
@@ -19,5 +18,5 @@ import type { UserWithoutPassword } from '../../types.js';
|
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
20
|
export declare const useServerAuth: () => {
|
|
22
|
-
getCurrentUser: (event:
|
|
21
|
+
getCurrentUser: (event: unknown) => Promise<UserWithoutPassword | null>;
|
|
23
22
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getCurrentUserFromToken } from "
|
|
2
|
-
import { getCookie } from "h3";
|
|
1
|
+
import { getCurrentUserFromToken } from "./user.js";
|
|
3
2
|
export const useServerAuth = () => {
|
|
4
3
|
const getCurrentUser = async (event) => {
|
|
5
4
|
const { useRuntimeConfig } = await import("#imports");
|
|
5
|
+
const { getCookie } = await import("h3");
|
|
6
6
|
const token = getCookie(event, "auth_token");
|
|
7
7
|
if (!token) {
|
|
8
8
|
return null;
|
package/package.json
CHANGED