nuxt-users 1.43.0 → 1.44.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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "1.43.0",
7
+ "version": "1.44.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,4 +1,4 @@
1
- import { useState, useRuntimeConfig, useFetch } from "#app";
1
+ import { useState, useRuntimeConfig, useFetch, useRequestHeaders } from "#app";
2
2
  import { computed, readonly } from "vue";
3
3
  let initializationPromise = null;
4
4
  export const useAuthentication = () => {
@@ -40,9 +40,11 @@ export const useAuthentication = () => {
40
40
  try {
41
41
  let userData = null;
42
42
  if (useSSR) {
43
+ const headers = useRequestHeaders(["cookie"]);
43
44
  const { data, error } = await useFetch(`${apiBasePath}/me`, {
44
45
  server: true,
45
- lazy: false
46
+ lazy: false,
47
+ ...Object.keys(headers).length ? { headers } : {}
46
48
  });
47
49
  if (error.value) {
48
50
  const statusCode = error.value.statusCode || error.value.status;
@@ -15,9 +15,7 @@ export default defineEventHandler(async (event) => {
15
15
  const newUser = await createUser({
16
16
  email: body.email,
17
17
  name: body.name,
18
- password: body.password,
19
- role: body.role
20
- // role is optional
18
+ password: body.password
21
19
  }, options);
22
20
  return { user: newUser };
23
21
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-users",
3
- "version": "1.43.0",
3
+ "version": "1.44.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",