@authup/client-web-nuxt 1.0.0-beta.30 → 1.0.0-beta.32

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.30",
4
+ "version": "1.0.0-beta.32",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -2,7 +2,7 @@ import {
2
2
  injectStore,
3
3
  storeToRefs
4
4
  } from "@authup/client-web-kit";
5
- import { hasOwnProperty } from "@authup/kit";
5
+ import { hasOwnProperty, omitRecord } from "@authup/kit";
6
6
  import { BuiltInPolicyType, PolicyData } from "@authup/access";
7
7
  import { RouteMetaKey } from "../constants.js";
8
8
  export class RoutingInterceptor {
@@ -18,9 +18,21 @@ export class RoutingInterceptor {
18
18
  this.loginRoute = runtimeOptions.loginRoute || "/login";
19
19
  }
20
20
  async execute(to, from) {
21
+ const code = typeof to.query.code === "string" ? to.query.code : void 0;
22
+ if (code) {
23
+ try {
24
+ await this.store.exchangeAuthorizationCode(code);
25
+ return {
26
+ path: to.path,
27
+ query: omitRecord(to.query, ["code"]),
28
+ hash: to.hash
29
+ };
30
+ } catch {
31
+ }
32
+ }
21
33
  try {
22
34
  await this.store.resolve();
23
- } catch (e) {
35
+ } catch {
24
36
  await this.store.logout();
25
37
  if (to.fullPath.startsWith(this.loginRoute)) {
26
38
  return void 0;
@@ -121,13 +133,13 @@ export class RoutingInterceptor {
121
133
  continue;
122
134
  }
123
135
  try {
124
- await this.store.permissionChecker.preCheckOneOf({
136
+ await this.store.permissionEvaluator.preEvaluateOneOf({
125
137
  name: permissions,
126
138
  input: new PolicyData({
127
139
  [BuiltInPolicyType.IDENTITY]: identity
128
140
  })
129
141
  });
130
- } catch (e) {
142
+ } catch {
131
143
  return false;
132
144
  }
133
145
  }
@@ -24,7 +24,7 @@ export type RuntimeOptions = {
24
24
  cookieDomainRuntimeKey?: string;
25
25
  /**
26
26
  * Path of the home route
27
- * Default: /logout
27
+ * Default: /
28
28
  */
29
29
  homeRoute?: string;
30
30
  /**
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.30",
4
+ "version": "1.0.0-beta.32",
5
5
  "description": "Nuxt module for the authup ecosystem",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "build": "nuxt-module-build prepare && nuxt-module-build build",
25
- "prepack": "nuxt-module-build build",
25
+ "prepack": "nuxt-module-build prepare && nuxt-module-build build",
26
26
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
27
27
  "lint": "eslint ."
28
28
  },
@@ -30,9 +30,9 @@
30
30
  "node": "^20.19.0 || ^22.13.0 || ^23.5.0 || >=24.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@authup/access": "^1.0.0-beta.30",
34
- "@authup/kit": "^1.0.0-beta.30",
35
- "@authup/client-web-kit": "^1.0.0-beta.30",
33
+ "@authup/access": "^1.0.0-beta.32",
34
+ "@authup/client-web-kit": "^1.0.0-beta.32",
35
+ "@authup/kit": "^1.0.0-beta.32",
36
36
  "@nuxt/kit": "^4.0.0",
37
37
  "pathtrace": "^2.1.0",
38
38
  "smob": "^1.6.1"
@@ -40,12 +40,25 @@
40
40
  "devDependencies": {
41
41
  "@nuxt/module-builder": "^1.0.2",
42
42
  "@pinia/nuxt": "^0.11.3",
43
- "nuxt": "^4.3.1",
43
+ "nuxt": "^4.4.2",
44
44
  "pinia": "^3.0.0",
45
- "vue-router": "^5.0.3"
45
+ "strip-literal": "^3.1.0",
46
+ "vue-router": "^5.0.4"
46
47
  },
47
48
  "peerDependencies": {
48
49
  "@pinia/nuxt": "*",
49
50
  "pinia": "^2.x || ^3.x"
50
- }
51
+ },
52
+ "keywords": [
53
+ "auth",
54
+ "authentication",
55
+ "authorization",
56
+ "nuxt",
57
+ "nuxt-module",
58
+ "middleware",
59
+ "route-guard",
60
+ "oauth2",
61
+ "session",
62
+ "vue"
63
+ ]
51
64
  }