nuxt-users 1.13.0 → 1.15.0

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 CHANGED
@@ -1,6 +1,43 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v1.15.0
5
+
6
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.14.0...v1.15.0)
7
+
8
+ ### 🚀 Enhancements
9
+
10
+ - Add getCurrentUser utility ([0096fb2](https://github.com/rrd108/nuxt-users/commit/0096fb2))
11
+
12
+ ### 💅 Refactors
13
+
14
+ - GetCurrentUser from a utility to a composable ([10149d2](https://github.com/rrd108/nuxt-users/commit/10149d2))
15
+
16
+ ### 🏡 Chore
17
+
18
+ - **release:** V1.14.0 ([6c32154](https://github.com/rrd108/nuxt-users/commit/6c32154))
19
+ - Fix whitespace ([517d60d](https://github.com/rrd108/nuxt-users/commit/517d60d))
20
+
21
+ ### ❤️ Contributors
22
+
23
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
24
+
25
+ ## v1.14.0
26
+
27
+ [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.13.0...v1.14.0)
28
+
29
+ ### 🚀 Enhancements
30
+
31
+ - Add getCurrentUser utility ([0096fb2](https://github.com/rrd108/nuxt-users/commit/0096fb2))
32
+
33
+ ### 🏡 Chore
34
+
35
+ - **release:** V1.13.0 ([a542d33](https://github.com/rrd108/nuxt-users/commit/a542d33))
36
+
37
+ ### ❤️ Contributors
38
+
39
+ - Rrd108 ([@rrd108](https://github.com/rrd108))
40
+
4
41
  ## v1.13.0
5
42
 
6
43
  [compare changes](https://github.com/rrd108/nuxt-users/compare/v1.12.0...v1.13.0)
package/dist/cli.mjs CHANGED
@@ -247,7 +247,7 @@ const main = defineCommand({
247
247
  meta: {
248
248
  name: "nuxt-users",
249
249
  description: "CLI for Nuxt Users Module - Manage users, migrations, and database operations",
250
- version: "1.12.0"
250
+ version: "1.14.0"
251
251
  },
252
252
  subCommands: {
253
253
  migrate,
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
3
  "configKey": "nuxtUsers",
4
- "version": "1.13.0",
4
+ "version": "1.15.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
@@ -0,0 +1,5 @@
1
+ import { type H3Event } from 'h3';
2
+ import type { UserWithoutPassword } from '../../types.js';
3
+ export declare const useServerAuth: () => {
4
+ getCurrentUser: (event: H3Event) => Promise<UserWithoutPassword | null>;
5
+ };
@@ -0,0 +1,17 @@
1
+ import { getCurrentUserFromToken } from "../server/utils/user.js";
2
+ import { useRuntimeConfig } from "#imports";
3
+ import { getCookie } from "h3";
4
+ const getCurrentUser = async (event) => {
5
+ const token = getCookie(event, "auth_token");
6
+ if (!token) {
7
+ return null;
8
+ }
9
+ const { nuxtUsers } = useRuntimeConfig();
10
+ const user = await getCurrentUserFromToken(token, nuxtUsers, false);
11
+ return user;
12
+ };
13
+ export const useServerAuth = () => {
14
+ return {
15
+ getCurrentUser
16
+ };
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.13.0",
3
+ "version": "1.15.0",
4
4
  "description": "A comprehensive user management module for Nuxt 3 and Nuxt 4 applications with authentication, authorization, database support, and CLI tools",
5
5
  "keywords": [
6
6
  "nuxt",