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
package/dist/module.json
CHANGED
|
@@ -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