@atlasauth/nuxt 0.1.5 → 0.2.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 +6 -0
- package/README.md +16 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +36 -23
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlasauth/nuxt changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 — 2026-10-24
|
|
4
|
+
Requires `@atlasauth/vue` with policy acceptance.
|
|
5
|
+
- **Policy acceptance** (terms of service, privacy, any policy the app defines). `usePolicies` and `usePolicyState` are
|
|
6
|
+
auto-imported, and `PolicyConsent`, `PolicyClickwrap`, `PolicyAcceptStep` and `PolicyGate` are registered as components,
|
|
7
|
+
from `@atlasauth/vue` (`<SignIn>` / `<SignUp>` already show the policies).
|
|
8
|
+
|
|
3
9
|
## 0.1.5
|
|
4
10
|
|
|
5
11
|
### Changed
|
package/README.md
CHANGED
|
@@ -108,6 +108,22 @@ async function callApi() {
|
|
|
108
108
|
> **do** — seeing is not doing. The server checking the same condition is what
|
|
109
109
|
> actually stops them. See the next section.
|
|
110
110
|
|
|
111
|
+
## Policy acceptance (terms of service, privacy)
|
|
112
|
+
|
|
113
|
+
`<SignIn>` and `<SignUp>` show the instance's policies themselves. For a custom form, `usePolicies()` is auto-imported and
|
|
114
|
+
`<PolicyConsent>`, `<PolicyClickwrap>`, `<PolicyAcceptStep>` and `<PolicyGate>` are registered:
|
|
115
|
+
|
|
116
|
+
```vue
|
|
117
|
+
<script setup>
|
|
118
|
+
const { controller, build } = usePolicies();
|
|
119
|
+
</script>
|
|
120
|
+
<template>
|
|
121
|
+
<PolicyConsent :controller="controller" />
|
|
122
|
+
<button @click="signUp({ policyAcceptances: build() })">Create account</button>
|
|
123
|
+
<PolicyGate /> <!-- signed-in banner when a policy needs re-accepting -->
|
|
124
|
+
</template>
|
|
125
|
+
```
|
|
126
|
+
|
|
111
127
|
## Read auth in a server route
|
|
112
128
|
|
|
113
129
|
`getAtlasAuth(event)` is auto-imported into every Nitro handler. It returns the
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addPlugin, addImports, addComponent, addServerHandler, addServerImports } from '@nuxt/kit';
|
|
2
2
|
|
|
3
|
+
const VUE_COMPOSABLES = [
|
|
4
|
+
"useAtlas",
|
|
5
|
+
"useUser",
|
|
6
|
+
"useSession",
|
|
7
|
+
"useAuth",
|
|
8
|
+
"useOrganization",
|
|
9
|
+
"useSignIn",
|
|
10
|
+
"useSignUp",
|
|
11
|
+
"useFlow",
|
|
12
|
+
// Policy acceptance (terms, privacy): load the instance's policies into a controller
|
|
13
|
+
// for a custom form, and subscribe a component to one.
|
|
14
|
+
"usePolicies",
|
|
15
|
+
"usePolicyState"
|
|
16
|
+
];
|
|
17
|
+
const VUE_COMPONENTS = [
|
|
18
|
+
"SignedIn",
|
|
19
|
+
"SignedOut",
|
|
20
|
+
"AtlasLoading",
|
|
21
|
+
"AtlasLoaded",
|
|
22
|
+
"Protect",
|
|
23
|
+
"SignIn",
|
|
24
|
+
"SignUp",
|
|
25
|
+
"UserButton",
|
|
26
|
+
"OrganizationSwitcher",
|
|
27
|
+
"UserProfile",
|
|
28
|
+
"OrganizationProfile",
|
|
29
|
+
// Policy acceptance (terms, privacy): the checkbox block with its document viewer, the
|
|
30
|
+
// clickwrap sentence, the held-sign-in step, and the signed-in re-acceptance banner.
|
|
31
|
+
"PolicyConsent",
|
|
32
|
+
"PolicyClickwrap",
|
|
33
|
+
"PolicyAcceptStep",
|
|
34
|
+
"PolicyGate"
|
|
35
|
+
];
|
|
36
|
+
|
|
3
37
|
const module = defineNuxtModule({
|
|
4
38
|
meta: {
|
|
5
39
|
name: "@atlasauth/nuxt",
|
|
@@ -30,32 +64,11 @@ const module = defineNuxtModule({
|
|
|
30
64
|
};
|
|
31
65
|
nuxt.options.build.transpile.push("@atlasauth/vue", "@atlasauth/js", "@atlasauth/authz", resolver.resolve("./runtime"));
|
|
32
66
|
addPlugin({ src: resolver.resolve("./runtime/plugin"), mode: "all" });
|
|
33
|
-
const composables =
|
|
34
|
-
"useAtlas",
|
|
35
|
-
"useUser",
|
|
36
|
-
"useSession",
|
|
37
|
-
"useAuth",
|
|
38
|
-
"useOrganization",
|
|
39
|
-
"useSignIn",
|
|
40
|
-
"useSignUp",
|
|
41
|
-
"useFlow"
|
|
42
|
-
];
|
|
67
|
+
const composables = VUE_COMPOSABLES;
|
|
43
68
|
for (const name of composables) {
|
|
44
69
|
addImports({ name, as: name, from: "@atlasauth/vue" });
|
|
45
70
|
}
|
|
46
|
-
const components =
|
|
47
|
-
"SignedIn",
|
|
48
|
-
"SignedOut",
|
|
49
|
-
"AtlasLoading",
|
|
50
|
-
"AtlasLoaded",
|
|
51
|
-
"Protect",
|
|
52
|
-
"SignIn",
|
|
53
|
-
"SignUp",
|
|
54
|
-
"UserButton",
|
|
55
|
-
"OrganizationSwitcher",
|
|
56
|
-
"UserProfile",
|
|
57
|
-
"OrganizationProfile"
|
|
58
|
-
];
|
|
71
|
+
const components = VUE_COMPONENTS;
|
|
59
72
|
for (const name of components) {
|
|
60
73
|
addComponent({ name, export: name, filePath: "@atlasauth/vue" });
|
|
61
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Official Nuxt 3 module for Atlas — SSR session verification (Nitro) built on the @atlasauth/vue client.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@nuxt/kit": "^3.13.0",
|
|
27
|
-
"@atlasauth/
|
|
28
|
-
"@atlasauth/
|
|
29
|
-
"@atlasauth/
|
|
30
|
-
"@atlasauth/
|
|
27
|
+
"@atlasauth/backend": "0.18.0",
|
|
28
|
+
"@atlasauth/vue": "0.10.0",
|
|
29
|
+
"@atlasauth/authz": "0.2.0",
|
|
30
|
+
"@atlasauth/js": "0.19.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"nuxt": "^3"
|