@meistrari/auth-nuxt 2.2.2 → 2.3.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
3
  "configKey": "telaAuth",
4
- "version": "2.2.2",
4
+ "version": "2.3.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,11 +1,4 @@
1
- type RawOrganization = {
2
- title: string;
3
- id: string;
4
- createdAt: Date;
5
- avatarUrl: string | null;
6
- metadata: string | null;
7
- slug: string | null;
8
- };
1
+ import type { FullOrganization } from '@meistrari/auth-core';
9
2
  /**
10
3
  * Composable for managing Tela application authentication with OAuth 2.0 PKCE flow
11
4
  *
@@ -44,7 +37,7 @@ export declare function useTelaApplicationAuth(): {
44
37
  login: () => Promise<void>;
45
38
  logout: () => Promise<void>;
46
39
  initSession: () => Promise<void>;
47
- getAvailableOrganizations: () => Promise<RawOrganization[]>;
40
+ getAvailableOrganizations: () => Promise<FullOrganization[]>;
48
41
  switchOrganization: (organizationId: string) => Promise<void>;
49
42
  refreshToken: () => Promise<void>;
50
43
  user: import("vue").Ref<{
@@ -76,6 +69,5 @@ export declare function useTelaApplicationAuth(): {
76
69
  banExpires?: Date | null | undefined;
77
70
  lastActiveAt?: Date | null | undefined;
78
71
  } | null>;
79
- activeOrganization: import("vue").Ref<Omit<import("@meistrari/auth-core").FullOrganization, "members" | "invitations" | "teams"> | null, Omit<import("@meistrari/auth-core").FullOrganization, "members" | "invitations" | "teams"> | null>;
72
+ activeOrganization: import("vue").Ref<FullOrganization | null, FullOrganization | null>;
80
73
  };
81
- export {};
@@ -3,16 +3,6 @@ import { AuthorizationFlowError, isTokenExpired, RefreshTokenExpiredError, UserN
3
3
  import { useApplicationSessionState } from "./state.js";
4
4
  const FIFTEEN_MINUTES = 60 * 15;
5
5
  const ONE_MINUTE = 60 * 1e3;
6
- function mapOrganization(organization) {
7
- return {
8
- name: organization.title,
9
- id: organization.id,
10
- createdAt: organization.createdAt,
11
- logo: organization.avatarUrl,
12
- metadata: organization.metadata,
13
- slug: organization.slug ?? ""
14
- };
15
- }
16
6
  export function useTelaApplicationAuth() {
17
7
  const appConfig = useRuntimeConfig().public.telaAuth;
18
8
  const accessTokenCookie = useCookie("tela-access-token", {
@@ -60,7 +50,7 @@ export function useTelaApplicationAuth() {
60
50
  method: "POST"
61
51
  });
62
52
  state.user.value = result.user;
63
- state.activeOrganization.value = mapOrganization(result.organization);
53
+ state.activeOrganization.value = result.organization;
64
54
  } catch (error) {
65
55
  console.error("[Auth Refresh] Failed to refresh token:", error);
66
56
  throw new RefreshTokenExpiredError();
@@ -91,7 +81,7 @@ export function useTelaApplicationAuth() {
91
81
  body: { organizationId }
92
82
  });
93
83
  state.user.value = result.user;
94
- state.activeOrganization.value = mapOrganization(result.organization);
84
+ state.activeOrganization.value = result.organization;
95
85
  } catch (error) {
96
86
  console.error("[Auth Switch Org] Failed to switch organization:", error);
97
87
  throw error;
@@ -161,5 +161,5 @@ export declare function useApplicationSessionState(): {
161
161
  banExpires?: Date | null | undefined;
162
162
  lastActiveAt?: Date | null | undefined;
163
163
  } | null>;
164
- activeOrganization: import("vue").Ref<Omit<FullOrganization, "members" | "invitations" | "teams"> | null, Omit<FullOrganization, "members" | "invitations" | "teams"> | null>;
164
+ activeOrganization: import("vue").Ref<FullOrganization | null, FullOrganization | null>;
165
165
  };
@@ -26,14 +26,6 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
26
26
  banExpires?: Date | null | undefined;
27
27
  lastActiveAt?: Date | null | undefined;
28
28
  };
29
- organization: {
30
- id: string;
31
- title: string;
32
- slug: string | null;
33
- avatarUrl: string | null;
34
- createdAt: Date;
35
- metadata: string | null;
36
- settings: unknown;
37
- };
29
+ organization: import("@meistrari/auth-core").FullOrganization;
38
30
  }>>;
39
31
  export default _default;
@@ -27,14 +27,6 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
27
27
  banExpires?: Date | null | undefined;
28
28
  lastActiveAt?: Date | null | undefined;
29
29
  };
30
- organization: {
31
- id: string;
32
- title: string;
33
- slug: string | null;
34
- avatarUrl: string | null;
35
- createdAt: Date;
36
- metadata: string | null;
37
- settings: unknown;
38
- };
30
+ organization: import("@meistrari/auth-core").FullOrganization;
39
31
  }>>;
40
32
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -31,7 +31,7 @@
31
31
  "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build"
32
32
  },
33
33
  "dependencies": {
34
- "@meistrari/auth-core": "1.10.0",
34
+ "@meistrari/auth-core": "1.11.0",
35
35
  "jose": "6.1.3"
36
36
  },
37
37
  "peerDependencies": {