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

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.33",
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;
@@ -50,19 +62,13 @@ export class RoutingInterceptor {
50
62
  if (!isValid) {
51
63
  if (from.path === to.path) {
52
64
  await this.store.logout();
53
- return {
54
- path: this.loginRoute
55
- };
65
+ return { path: this.loginRoute };
56
66
  }
57
67
  if (this.hasLoggedOutCondition(from)) {
58
68
  await this.store.logout();
59
- return {
60
- path: from.fullPath
61
- };
69
+ return { path: from.fullPath };
62
70
  }
63
- return {
64
- path: from.fullPath
65
- };
71
+ return { path: from.fullPath };
66
72
  }
67
73
  return void 0;
68
74
  }
@@ -121,13 +127,11 @@ export class RoutingInterceptor {
121
127
  continue;
122
128
  }
123
129
  try {
124
- await this.store.permissionChecker.preCheckOneOf({
130
+ await this.store.permissionEvaluator.preEvaluateOneOf({
125
131
  name: permissions,
126
- input: new PolicyData({
127
- [BuiltInPolicyType.IDENTITY]: identity
128
- })
132
+ input: new PolicyData({ [BuiltInPolicyType.IDENTITY]: identity })
129
133
  });
130
- } catch (e) {
134
+ } catch {
131
135
  return false;
132
136
  }
133
137
  }
@@ -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.33",
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,22 +30,35 @@
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.33",
34
+ "@authup/client-web-kit": "^1.0.0-beta.33",
35
+ "@authup/kit": "^1.0.0-beta.33",
36
36
  "@nuxt/kit": "^4.0.0",
37
- "pathtrace": "^2.1.0",
37
+ "pathtrace": "^2.2.0",
38
38
  "smob": "^1.6.1"
39
39
  },
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
  }