@atlasauth/nuxt 0.1.5 → 0.2.1
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 +11 -0
- package/README.md +17 -0
- package/dist/module.d.mts +5 -0
- package/dist/module.d.ts +5 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +38 -23
- package/dist/runtime/nuxt-shims.d.ts +1 -0
- package/dist/runtime/server/backend.js +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlasauth/nuxt changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 — 2026-11-06
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `previousIssuers` module option (server-only runtime config), so a sign-in host change does not sign users out: tokens from a listed former issuer are accepted. Absent means only `issuer` is accepted.
|
|
7
|
+
|
|
8
|
+
## 0.2.0 — 2026-10-24
|
|
9
|
+
Requires `@atlasauth/vue` with policy acceptance.
|
|
10
|
+
- **Policy acceptance** (terms of service, privacy, any policy the app defines). `usePolicies` and `usePolicyState` are
|
|
11
|
+
auto-imported, and `PolicyConsent`, `PolicyClickwrap`, `PolicyAcceptStep` and `PolicyGate` are registered as components,
|
|
12
|
+
from `@atlasauth/vue` (`<SignIn>` / `<SignUp>` already show the policies).
|
|
13
|
+
|
|
3
14
|
## 0.1.5
|
|
4
15
|
|
|
5
16
|
### Changed
|
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ export default defineNuxtConfig({
|
|
|
41
41
|
atlas: {
|
|
42
42
|
jwksUrl: '', // NUXT_ATLAS_JWKS_URL
|
|
43
43
|
issuer: '', // NUXT_ATLAS_ISSUER
|
|
44
|
+
// previousIssuers: ['https://old-host.example.com'], // optional: still accept a former issuer
|
|
44
45
|
// authorizedParties: ['https://app.example.com'], // optional azp allowlist
|
|
45
46
|
},
|
|
46
47
|
public: {
|
|
@@ -108,6 +109,22 @@ async function callApi() {
|
|
|
108
109
|
> **do** — seeing is not doing. The server checking the same condition is what
|
|
109
110
|
> actually stops them. See the next section.
|
|
110
111
|
|
|
112
|
+
## Policy acceptance (terms of service, privacy)
|
|
113
|
+
|
|
114
|
+
`<SignIn>` and `<SignUp>` show the instance's policies themselves. For a custom form, `usePolicies()` is auto-imported and
|
|
115
|
+
`<PolicyConsent>`, `<PolicyClickwrap>`, `<PolicyAcceptStep>` and `<PolicyGate>` are registered:
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<script setup>
|
|
119
|
+
const { controller, build } = usePolicies();
|
|
120
|
+
</script>
|
|
121
|
+
<template>
|
|
122
|
+
<PolicyConsent :controller="controller" />
|
|
123
|
+
<button @click="signUp({ policyAcceptances: build() })">Create account</button>
|
|
124
|
+
<PolicyGate /> <!-- signed-in banner when a policy needs re-accepting -->
|
|
125
|
+
</template>
|
|
126
|
+
```
|
|
127
|
+
|
|
111
128
|
## Read auth in a server route
|
|
112
129
|
|
|
113
130
|
`getAtlasAuth(event)` is auto-imported into every Nitro handler. It returns the
|
package/dist/module.d.mts
CHANGED
|
@@ -40,6 +40,11 @@ interface ModuleOptions {
|
|
|
40
40
|
* an unchecked issuer would accept a token from any Atlas instance.
|
|
41
41
|
*/
|
|
42
42
|
issuer?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Former issuers still accepted during a sign-in host change. SERVER-ONLY.
|
|
45
|
+
* Absent means only `issuer` is accepted.
|
|
46
|
+
*/
|
|
47
|
+
previousIssuers?: string[];
|
|
43
48
|
/**
|
|
44
49
|
* Optional `azp` allowlist. When set, a token minted for another origin is
|
|
45
50
|
* refused server-side (§7.3). SERVER-ONLY.
|
package/dist/module.d.ts
CHANGED
|
@@ -40,6 +40,11 @@ interface ModuleOptions {
|
|
|
40
40
|
* an unchecked issuer would accept a token from any Atlas instance.
|
|
41
41
|
*/
|
|
42
42
|
issuer?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Former issuers still accepted during a sign-in host change. SERVER-ONLY.
|
|
45
|
+
* Absent means only `issuer` is accepted.
|
|
46
|
+
*/
|
|
47
|
+
previousIssuers?: string[];
|
|
43
48
|
/**
|
|
44
49
|
* Optional `azp` allowlist. When set, a token minted for another origin is
|
|
45
50
|
* refused server-side (§7.3). SERVER-ONLY.
|
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",
|
|
@@ -13,6 +47,7 @@ const module = defineNuxtModule({
|
|
|
13
47
|
frontendApi: "",
|
|
14
48
|
jwksUrl: "",
|
|
15
49
|
issuer: "",
|
|
50
|
+
previousIssuers: [],
|
|
16
51
|
authorizedParties: []
|
|
17
52
|
},
|
|
18
53
|
setup(options, nuxt) {
|
|
@@ -26,36 +61,16 @@ const module = defineNuxtModule({
|
|
|
26
61
|
nuxt.options.runtimeConfig.atlas = {
|
|
27
62
|
jwksUrl: options.jwksUrl || privateConfig.jwksUrl || "",
|
|
28
63
|
issuer: options.issuer || privateConfig.issuer || "",
|
|
64
|
+
previousIssuers: options.previousIssuers?.length ? options.previousIssuers : privateConfig.previousIssuers || [],
|
|
29
65
|
authorizedParties: options.authorizedParties?.length ? options.authorizedParties : privateConfig.authorizedParties || []
|
|
30
66
|
};
|
|
31
67
|
nuxt.options.build.transpile.push("@atlasauth/vue", "@atlasauth/js", "@atlasauth/authz", resolver.resolve("./runtime"));
|
|
32
68
|
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
|
-
];
|
|
69
|
+
const composables = VUE_COMPOSABLES;
|
|
43
70
|
for (const name of composables) {
|
|
44
71
|
addImports({ name, as: name, from: "@atlasauth/vue" });
|
|
45
72
|
}
|
|
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
|
-
];
|
|
73
|
+
const components = VUE_COMPONENTS;
|
|
59
74
|
for (const name of components) {
|
|
60
75
|
addComponent({ name, export: name, filePath: "@atlasauth/vue" });
|
|
61
76
|
}
|
|
@@ -12,6 +12,7 @@ export function atlasBackend() {
|
|
|
12
12
|
cached = new AtlasBackend({
|
|
13
13
|
jwksUrl: atlas.jwksUrl,
|
|
14
14
|
issuer: atlas.issuer,
|
|
15
|
+
previousIssuers: atlas.previousIssuers?.length ? atlas.previousIssuers : void 0,
|
|
15
16
|
authorizedParties: atlas.authorizedParties?.length ? atlas.authorizedParties : void 0
|
|
16
17
|
});
|
|
17
18
|
return cached;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/nuxt",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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/vue": "0.
|
|
28
|
-
"@atlasauth/js": "0.
|
|
29
|
-
"@atlasauth/backend": "0.
|
|
30
|
-
"@atlasauth/authz": "0.
|
|
27
|
+
"@atlasauth/vue": "0.18.7",
|
|
28
|
+
"@atlasauth/js": "0.34.6",
|
|
29
|
+
"@atlasauth/backend": "0.39.0",
|
|
30
|
+
"@atlasauth/authz": "0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"nuxt": "^3"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "nuxt-module-build build",
|
|
50
|
-
"typecheck": "
|
|
50
|
+
"typecheck": "tsgo -p tsconfig.json --noEmit --incremental --tsBuildInfoFile node_modules/.cache/typecheck.tsbuildinfo",
|
|
51
51
|
"test": "vitest run"
|
|
52
52
|
}
|
|
53
53
|
}
|