oidc-spa 10.0.9 → 10.1.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.
@@ -76,7 +76,7 @@ const StateDataCookie_1 = require("./StateDataCookie");
76
76
  const loadWebcryptoLinerShim_1 = require("../tools/loadWebcryptoLinerShim");
77
77
  const lazySessionStorage_2 = require("../tools/lazySessionStorage");
78
78
  // NOTE: Replaced at build time
79
- const VERSION = "10.0.9";
79
+ const VERSION = "10.1.0";
80
80
  const globalContext = {
81
81
  prOidcByConfigId: new Map(),
82
82
  hasLogoutBeenCalled: (0, id_1.id)(false),
@@ -36,7 +36,7 @@ import { setStateDataCookieIfEnabled, clearStateDataCookie, getIsStateDataCookie
36
36
  import { loadWebcryptoLinerShim, hasLoadWebcryptoLinerShimBeenCalled } from "../tools/loadWebcryptoLinerShim.mjs";
37
37
  import { SESSION_STORAGE_GLOBAL_PREFIX } from "../tools/lazySessionStorage.mjs";
38
38
  // NOTE: Replaced at build time
39
- const VERSION = "10.0.9";
39
+ const VERSION = "10.1.0";
40
40
  const globalContext = {
41
41
  prOidcByConfigId: new Map(),
42
42
  hasLogoutBeenCalled: id(false),
@@ -0,0 +1,3 @@
1
+ import { type OidcSpaVitePluginParams } from "../vite-plugin";
2
+ export declare const nuxtOidcSpaModule: import("@nuxt/schema").NuxtModule<OidcSpaVitePluginParams, Partial<OidcSpaVitePluginParams>, true>;
3
+ export default nuxtOidcSpaModule;
@@ -0,0 +1,24 @@
1
+ import { defineNuxtModule, addVitePlugin } from "@nuxt/kit";
2
+ import { oidcSpa } from "../vite-plugin/index.mjs";
3
+ export const nuxtOidcSpaModule = defineNuxtModule().with({
4
+ meta: {
5
+ name: "oidc-spa",
6
+ configKey: "oidcSpa", // nuxt.config.ts: { oidcSpa: { ... } }
7
+ compatibility: {
8
+ nuxt: ">=3.0.0"
9
+ }
10
+ },
11
+ setup(resolvedOptions, nuxt) {
12
+ // Check if SSR is disabled
13
+ if (nuxt.options.ssr !== false) {
14
+ throw new Error("Oidc-spa module requires SSR to be disabled. Please set `ssr: false` in your nuxt.config.ts.");
15
+ }
16
+ // Add vite plugin to only client side
17
+ addVitePlugin(oidcSpa(resolvedOptions || undefined), {
18
+ client: true,
19
+ server: false
20
+ });
21
+ }
22
+ });
23
+ export default nuxtOidcSpaModule;
24
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/nuxt-spa/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAgC,MAAM,gBAAgB,CAAC;AAEvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,EAA2B,CAAC,IAAI,CAAC;IAC9E,IAAI,EAAE;QACF,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,EAAE,uCAAuC;QAC7D,aAAa,EAAE;YACX,IAAI,EAAE,SAAS;SAClB;KACJ;IACD,KAAK,CAAC,eAAe,EAAE,IAAI;QACvB,2BAA2B;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACX,8FAA8F,CACjG,CAAC;QACN,CAAC;QAED,sCAAsC;QACtC,aAAa,CAAC,OAAO,CAAC,eAAe,IAAI,SAAS,CAAC,EAAE;YACjD,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oidc-spa",
3
- "version": "10.0.9",
3
+ "version": "10.1.0",
4
4
  "description": "OpenID Connect / OAuth2 solution for client-first Web Applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,6 +25,7 @@
25
25
  "@angular/common": "*",
26
26
  "@angular/core": "*",
27
27
  "@angular/router": "*",
28
+ "@nuxt/kit": "*",
28
29
  "@tanstack/react-router": "*",
29
30
  "@tanstack/react-start": "*",
30
31
  "@types/react": "*",
@@ -50,6 +51,9 @@
50
51
  "@angular/common": {
51
52
  "optional": true
52
53
  },
54
+ "@nuxt/kit": {
55
+ "optional": true
56
+ },
53
57
  "@tanstack/react-start": {
54
58
  "optional": true
55
59
  },
@@ -91,6 +95,12 @@
91
95
  "import": "./esm/vite-plugin/index.mjs",
92
96
  "default": "./esm/vite-plugin/index.mjs"
93
97
  },
98
+ "./nuxt-spa": {
99
+ "types": "./esm/nuxt-spa/index.d.ts",
100
+ "module": "./esm/nuxt-spa/index.mjs",
101
+ "import": "./esm/nuxt-spa/index.mjs",
102
+ "default": "./esm/nuxt-spa/index.mjs"
103
+ },
94
104
  "./server": {
95
105
  "module": "./esm/server/index.mjs",
96
106
  "import": "./esm/server/index.mjs",
@@ -0,0 +1,28 @@
1
+ import { defineNuxtModule, addVitePlugin } from "@nuxt/kit";
2
+ import { oidcSpa, type OidcSpaVitePluginParams } from "../vite-plugin";
3
+
4
+ export const nuxtOidcSpaModule = defineNuxtModule<OidcSpaVitePluginParams>().with({
5
+ meta: {
6
+ name: "oidc-spa",
7
+ configKey: "oidcSpa", // nuxt.config.ts: { oidcSpa: { ... } }
8
+ compatibility: {
9
+ nuxt: ">=3.0.0"
10
+ }
11
+ },
12
+ setup(resolvedOptions, nuxt) {
13
+ // Check if SSR is disabled
14
+ if (nuxt.options.ssr !== false) {
15
+ throw new Error(
16
+ "Oidc-spa module requires SSR to be disabled. Please set `ssr: false` in your nuxt.config.ts."
17
+ );
18
+ }
19
+
20
+ // Add vite plugin to only client side
21
+ addVitePlugin(oidcSpa(resolvedOptions || undefined), {
22
+ client: true,
23
+ server: false
24
+ });
25
+ }
26
+ });
27
+
28
+ export default nuxtOidcSpaModule;