@authup/client-web-nuxt 1.0.0-beta.68 → 1.0.0-beta.69

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@authup/client-web-nuxt",
3
3
  "configKey": "authup",
4
- "version": "1.0.0-beta.68",
4
+ "version": "1.0.0-beta.69",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "3.6.1"
@@ -31,20 +31,19 @@ export class RoutingInterceptor {
31
31
  const { redirect } = to.query;
32
32
  const destination = typeof redirect === "string" ? this.resolveDestination(redirect) : void 0;
33
33
  try {
34
- if (request) {
35
- const state = typeof to.query.state === "string" ? to.query.state : void 0;
36
- if (request.state !== state) {
37
- throw new Error("The authorization request state does not match.");
38
- }
39
- await this.store.exchangeAuthorizationCode(code, {
40
- code_verifier: request.code_verifier,
41
- redirect_uri: request.redirect_uri,
42
- client_id: request.client_id,
43
- realm_id: request.realm_id
44
- });
45
- } else {
46
- await this.store.exchangeAuthorizationCode(code);
34
+ if (!request) {
35
+ throw new Error("No authorization request is pending.");
36
+ }
37
+ const state = typeof to.query.state === "string" ? to.query.state : void 0;
38
+ if (request.state !== state) {
39
+ throw new Error("The authorization request state does not match.");
47
40
  }
41
+ await this.store.exchangeAuthorizationCode(code, {
42
+ code_verifier: request.code_verifier,
43
+ redirect_uri: request.redirect_uri,
44
+ client_id: request.client_id,
45
+ realm_id: request.realm_id
46
+ });
48
47
  clearAuthorizationRequest();
49
48
  if (destination) {
50
49
  const query = {};
@@ -12,6 +12,7 @@ import {
12
12
  defineNuxtPlugin,
13
13
  tryUseNuxtApp,
14
14
  useCookie,
15
+ useRequestURL,
15
16
  useRuntimeConfig
16
17
  } from "#imports";
17
18
  function buildPreferenceRef(name, unset, options) {
@@ -102,12 +103,15 @@ export default defineNuxtPlugin({
102
103
  install(ctx.vueApp, {
103
104
  pinia: ctx.$pinia,
104
105
  baseURL,
106
+ // A refresh during the server render rotates the token cookies
107
+ // too, and the kit cannot see the scheme without a window.
108
+ cookieSecure: useRequestURL().protocol === "https:",
105
109
  cookieSet: (key, value, options) => {
106
110
  const app = tryUseNuxtApp();
107
111
  if (app) {
108
112
  const cookie = useCookie(cookieName(key), {
109
- ...cookieOptions,
110
- ...options || {}
113
+ ...options || {},
114
+ ...cookieOptions
111
115
  });
112
116
  cookie.value = value;
113
117
  }
@@ -116,8 +120,8 @@ export default defineNuxtPlugin({
116
120
  const app = tryUseNuxtApp();
117
121
  if (app) {
118
122
  const cookie = useCookie(cookieName(key), {
119
- ...cookieOptions,
120
- ...options || {}
123
+ ...options || {},
124
+ ...cookieOptions
121
125
  });
122
126
  cookie.value = null;
123
127
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@authup/client-web-nuxt",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.68",
4
+ "version": "1.0.0-beta.69",
5
5
  "description": "Nuxt module for the authup ecosystem",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -32,28 +32,28 @@
32
32
  "node": "^22.13.0 || ^23.5.0 || >=24.0.0"
33
33
  },
34
34
  "dependencies": {
35
- "@authup/access": "^1.0.0-beta.68",
36
- "@authup/client-web-kit": "^1.0.0-beta.68",
37
- "@authup/core-http-kit": "^1.0.0-beta.68",
38
- "@authup/kit": "^1.0.0-beta.68",
39
- "@nuxt/kit": "^4.0.0",
35
+ "@authup/access": "^1.0.0-beta.69",
36
+ "@authup/client-web-kit": "^1.0.0-beta.69",
37
+ "@authup/core-http-kit": "^1.0.0-beta.69",
38
+ "@authup/kit": "^1.0.0-beta.69",
39
+ "@nuxt/kit": "^4.6.1",
40
40
  "pathtrace": "^2.2.0",
41
41
  "smob": "^1.6.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@nuxt/module-builder": "^1.0.3",
45
- "@nuxt/schema": "^4.0.0",
45
+ "@nuxt/schema": "^4.6.1",
46
46
  "@pinia/nuxt": "^1.0.2",
47
47
  "cross-env": "^10.1.0",
48
48
  "fix-dts-default-cjs-exports": "^1.0.1",
49
49
  "mkdist": "^2.3.0",
50
- "nuxt": "^4.5.2",
50
+ "nuxt": "^4.6.1",
51
51
  "pinia": "^4.0.3",
52
52
  "rollup-plugin-dts": "^6.5.1",
53
53
  "strip-literal": "^4.0.0",
54
- "vitest": "^4.0.14",
54
+ "vitest": "^5.0.3",
55
55
  "vue": "^3.5.43",
56
- "vue-router": "^5.3.1"
56
+ "vue-router": "^5.4.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@pinia/nuxt": "*",