vuethenticate 0.1.2 → 0.1.5

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/README.md CHANGED
@@ -98,6 +98,7 @@ function onError(error) {
98
98
  // router.js
99
99
  import { createRouter, createWebHistory } from 'vue-router'
100
100
  import CallbackPage from './CallbackPage.vue'
101
+ import LogoutCallbackPage from './LogoutCallbackPage.vue'
101
102
  import SilentCallbackPage from './SilentCallbackPage.vue'
102
103
 
103
104
  const routes = [
@@ -105,6 +106,10 @@ const routes = [
105
106
  path: '/auth/callback',
106
107
  component: CallbackPage
107
108
  },
109
+ {
110
+ path: '/auth/logout-callback',
111
+ component: LogoutCallbackPage
112
+ },
108
113
  {
109
114
  path: '/auth/silent-callback',
110
115
  component: SilentCallbackPage
@@ -264,6 +269,76 @@ Component for handling OAuth callback. **Note**: This component requires `useAut
264
269
  | `success` | `User, state?: TState` | Emitted on successful authentication with typed state |
265
270
  | `error` | `Error` | Emitted on authentication error |
266
271
 
272
+ ### `<LogoutCallback>`
273
+
274
+ Component for handling OAuth logout callback. **Note**: This component requires `useAuth()` to be called in a parent component first.
275
+
276
+ #### Props
277
+
278
+ | Property | Type | Required | Description |
279
+ |----------|------|----------|-------------|
280
+ | `onSuccess` | `(state?: TState) => void` | | Success callback with typed state |
281
+ | `onError` | `(error: Error) => void` | | Error callback |
282
+
283
+ #### Slots
284
+
285
+ | Slot | Props | Description |
286
+ |------|-------|-------------|
287
+ | `default` | - | Loading content |
288
+ | `error` | `{ error: Error }` | Error content |
289
+ | `success` | - | Success content |
290
+
291
+ #### Events
292
+
293
+ | Event | Payload | Description |
294
+ |-------|---------|-------------|
295
+ | `success` | `state?: TState` | Emitted on successful logout with typed state |
296
+ | `error` | `Error` | Emitted on logout error |
297
+
298
+ #### Usage
299
+
300
+ ```vue
301
+ <!-- LogoutCallbackPage.vue -->
302
+ <script setup>
303
+ import { LogoutCallback } from 'vuethenticate'
304
+
305
+ function onSuccess(state) {
306
+ console.log('Logout successful:', state)
307
+ // Redirect to home or show success message
308
+ window.location.href = '/'
309
+ }
310
+
311
+ function onError(error) {
312
+ console.error('Logout failed:', error)
313
+ // Handle error - redirect or show error
314
+ window.location.href = '/error'
315
+ }
316
+ </script>
317
+
318
+ <template>
319
+ <LogoutCallback
320
+ :onSuccess="onSuccess"
321
+ :onError="onError"
322
+ >
323
+ <div>Processing logout...</div>
324
+
325
+ <template #error="{ error }">
326
+ <div>
327
+ <h2>Logout Failed</h2>
328
+ <p>{{ error.message }}</p>
329
+ </div>
330
+ </template>
331
+
332
+ <template #success>
333
+ <div>
334
+ <h2>Logout Successful</h2>
335
+ <p>You have been logged out successfully.</p>
336
+ </div>
337
+ </template>
338
+ </LogoutCallback>
339
+ </template>
340
+ ```
341
+
267
342
  ### `<SilentCallback>`
268
343
 
269
344
  Component for handling silent token renewal callbacks. This component should be mounted on a separate route (typically `/auth/silent-callback`) and is used internally by the library for automatic token refresh. **Note**: This component requires `useAuth()` to be called in a parent component first.
@@ -1 +1 @@
1
- {"version":3,"file":"AuthCallback.vue.d.ts","sourceRoot":"","sources":["../../src/components/AuthCallback.vue"],"names":[],"mappings":"AAgBA;AA2EA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;yBAG1B,MAAM,GAAG,OAAO,EAChC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAiHO,mBAAmB,CAAC;;;uLAAkE,CAAC,4BAA2B;oBACzG,OA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M,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -13,11 +13,14 @@ export declare const useAuth: <TState = unknown>(config: AuthConfig) => UseAuthR
13
13
  * @returns Callback processing methods and initialization state
14
14
  */
15
15
  export declare const useAuthCallbacks: <TState = unknown>() => {
16
- processCallback: (url?: string) => Promise<{
16
+ processCallback: () => Promise<{
17
17
  user: User;
18
18
  state?: TState;
19
19
  }>;
20
- processSilentCallback: (url?: string) => Promise<void>;
20
+ processLogoutCallback: () => Promise<{
21
+ state?: TState;
22
+ }>;
23
+ processSilentCallback: () => Promise<void>;
21
24
  isInitialized: Ref<boolean, boolean>;
22
25
  isInitializing: Ref<boolean, boolean>;
23
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/composables/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAoB,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,KAAK,IAAI,EAAe,MAAM,gBAAgB,CAAC;AAwNxD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,OAAO,EACpC,QAAQ,UAAU,KACnB,aAAa,CAAC,MAAM,CAsNtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,GAAG,OAAO;4BAenC,MAAM,KACb,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;kCAiBC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;;;CAapE,CAAC"}
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/composables/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAoB,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,KAAK,IAAI,EAAe,MAAM,gBAAgB,CAAC;AAwNxD;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,OAAO,EACpC,QAAQ,UAAU,KACnB,aAAa,CAAC,MAAM,CAsNtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,GAAG,OAAO;2BAaX,OAAO,CAAC;QACtC,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;iCAkBsC,OAAO,CAAC;QAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;iCAYsC,OAAO,CAAC,IAAI,CAAC;;;CAaxD,CAAC"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ref as m, computed as I, watch as W, defineComponent as M, onMounted as R, createElementBlock as _, openBlock as L, Fragment as $, renderSlot as b, createCommentVNode as C, unref as F, createElementVNode as S, toDisplayString as P } from "vue";
1
+ import { ref as m, computed as I, watch as W, defineComponent as z, onMounted as R, createElementBlock as L, openBlock as _, Fragment as $, renderSlot as C, createCommentVNode as U, unref as F, createElementVNode as S, toDisplayString as P } from "vue";
2
2
  import { WebStorageStateStore as j, UserManager as G } from "oidc-client-ts";
3
3
  function H(e) {
4
4
  const r = typeof window < "u" ? window.location.origin : "";
@@ -6,14 +6,14 @@ function H(e) {
6
6
  authority: e.authority,
7
7
  client_id: e.clientId,
8
8
  client_secret: e.clientSecret,
9
- client_authentication: e.clientAuthentication ?? "client_secret_basic",
9
+ client_authentication: e.clientAuthentication,
10
10
  redirect_uri: e.redirectUri ?? `${r}/auth/callback`,
11
11
  scope: e.scope ?? "openid profile",
12
12
  response_type: e.responseType ?? "code",
13
13
  userStore: e.storage ? new j({ store: J(e.storage) }) : void 0,
14
14
  automaticSilentRenew: e.automaticSilentRenew ?? !0,
15
15
  silent_redirect_uri: e.silentRedirectUri ?? `${r}/auth/silent-callback`,
16
- post_logout_redirect_uri: e.postLogoutRedirectUri ?? r,
16
+ post_logout_redirect_uri: e.postLogoutRedirectUri ?? `${r}/auth/logout-callback`,
17
17
  includeIdTokenInSilentRenew: !0,
18
18
  accessTokenExpiringNotificationTimeInSeconds: 60
19
19
  };
@@ -64,17 +64,17 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
64
64
  const r = K(e), t = E.get(r);
65
65
  if (t)
66
66
  return t;
67
- const l = Z(e), a = m(!1), o = m(!1), n = m(null), s = m(!1), p = m(null), y = I(() => !!n.value && !n.value.expired), d = I(() => {
67
+ const i = Z(e), n = m(!1), u = m(!1), a = m(null), s = m(!1), p = m(null), y = I(() => !!a.value && !a.value.expired), d = I(() => {
68
68
  var h;
69
- return ((h = n.value) == null ? void 0 : h.access_token) || null;
69
+ return ((h = a.value) == null ? void 0 : h.access_token) || null;
70
70
  }), w = I(() => {
71
71
  var h;
72
- return !!((h = n.value) != null && h.expired);
72
+ return !!((h = a.value) != null && h.expired);
73
73
  }), k = {
74
- userManager: l,
75
- isInitialized: a,
76
- isInitializing: o,
77
- user: n,
74
+ userManager: i,
75
+ isInitialized: n,
76
+ isInitializing: u,
77
+ user: a,
78
78
  isLoading: s,
79
79
  error: p,
80
80
  isAuthenticated: y,
@@ -86,9 +86,9 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
86
86
  }, Z = (e) => {
87
87
  const r = H(e);
88
88
  return new G(r);
89
- }, f = (e, r, t, l) => {
90
- const a = e instanceof Error ? e : new Error(r);
91
- return t.value = a, l == null || l(a), a;
89
+ }, f = (e, r, t, i) => {
90
+ const n = e instanceof Error ? e : new Error(r);
91
+ return t.value = n, i == null || i(n), n;
92
92
  }, ee = (e) => {
93
93
  var r, t;
94
94
  if (!((r = e.authority) != null && r.trim()))
@@ -100,15 +100,15 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
100
100
  } catch {
101
101
  throw new Error("AuthConfig: authority must be a valid URL");
102
102
  }
103
- }, z = async (e, r = 1e4) => {
103
+ }, x = async (e, r = 1e4) => {
104
104
  if (!e.isInitialized.value)
105
- return new Promise((t, l) => {
106
- const a = setTimeout(() => {
107
- l(new Error("Authentication initialization timeout"));
108
- }, r), o = W(
105
+ return new Promise((t, i) => {
106
+ const n = setTimeout(() => {
107
+ i(new Error("Authentication initialization timeout"));
108
+ }, r), u = W(
109
109
  e.isInitialized,
110
- (n) => {
111
- n && (clearTimeout(a), o(), t());
110
+ (a) => {
111
+ a && (clearTimeout(n), u(), t());
112
112
  },
113
113
  { immediate: !0 }
114
114
  );
@@ -117,105 +117,105 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
117
117
  ee(e);
118
118
  const r = Y(e), {
119
119
  userManager: t,
120
- isInitialized: l,
121
- isInitializing: a,
122
- user: o,
123
- isLoading: n,
120
+ isInitialized: i,
121
+ isInitializing: n,
122
+ user: u,
123
+ isLoading: a,
124
124
  error: s,
125
125
  isAuthenticated: p,
126
126
  accessToken: y,
127
127
  isExpired: d
128
128
  } = r, w = K(e), k = async () => {
129
- if (!(a.value || l.value))
129
+ if (!(n.value || i.value))
130
130
  try {
131
- a.value = !0, n.value = !0, s.value = null;
132
- const c = await t.getUser();
133
- if (c)
134
- if (!c.expired)
135
- o.value = c;
131
+ n.value = !0, a.value = !0, s.value = null;
132
+ const o = await t.getUser();
133
+ if (o)
134
+ if (!o.expired)
135
+ u.value = o;
136
136
  else if (e.automaticSilentRenew !== !1)
137
137
  try {
138
- await x();
139
- } catch (i) {
138
+ await M();
139
+ } catch (l) {
140
140
  console.warn(
141
141
  "Silent renewal failed during initialization:",
142
- i
143
- ), await t.removeUser(), o.value = null;
142
+ l
143
+ ), await t.removeUser(), u.value = null;
144
144
  }
145
145
  else
146
- await t.removeUser(), o.value = null;
147
- } catch (c) {
146
+ await t.removeUser(), u.value = null;
147
+ } catch (o) {
148
148
  f(
149
- c,
149
+ o,
150
150
  "Failed to initialize authentication",
151
151
  s,
152
152
  e.onError
153
153
  );
154
154
  } finally {
155
- n.value = !1, a.value = !1, l.value = !0;
155
+ a.value = !1, n.value = !1, i.value = !0;
156
156
  }
157
- }, h = async (c) => {
157
+ }, h = async (o) => {
158
158
  try {
159
- n.value = !0, s.value = null, await t.signinRedirect({ state: c });
160
- } catch (i) {
161
- f(i, "Sign in failed", s, e.onError);
159
+ a.value = !0, s.value = null, await t.signinRedirect({ state: o });
160
+ } catch (l) {
161
+ f(l, "Sign in failed", s, e.onError);
162
162
  } finally {
163
- n.value = !1;
163
+ a.value = !1;
164
164
  }
165
- }, q = async (c) => {
165
+ }, q = async (o) => {
166
166
  try {
167
- n.value = !0, s.value = null, o.value = null, await t.signoutRedirect({ state: c });
168
- } catch (i) {
169
- f(i, "Sign out failed", s, e.onError);
167
+ a.value = !0, s.value = null, u.value = null, await t.signoutRedirect({ state: o });
168
+ } catch (l) {
169
+ f(l, "Sign out failed", s, e.onError);
170
170
  } finally {
171
- n.value = !1;
171
+ a.value = !1;
172
172
  }
173
- }, x = async () => {
173
+ }, M = async () => {
174
174
  try {
175
- n.value = !0, s.value = null;
176
- const c = await t.signinSilent();
177
- o.value = c;
178
- } catch (c) {
175
+ a.value = !0, s.value = null;
176
+ const o = await t.signinSilent();
177
+ u.value = o;
178
+ } catch (o) {
179
179
  throw f(
180
- c,
180
+ o,
181
181
  "Silent renewal failed",
182
182
  s,
183
183
  e.onError
184
184
  );
185
185
  } finally {
186
- n.value = !1;
186
+ a.value = !1;
187
187
  }
188
188
  }, B = () => {
189
189
  s.value = null;
190
- }, O = (c, i) => {
191
- const { userManager: g, user: A, error: D, eventCallbacks: v } = c;
192
- v.userLoaded = (u) => {
193
- var U;
194
- A.value = u, (U = i.onUserLoaded) == null || U.call(i, u);
190
+ }, O = (o, l) => {
191
+ const { userManager: g, user: A, error: D, eventCallbacks: v } = o;
192
+ v.userLoaded = (c) => {
193
+ var b;
194
+ A.value = c, (b = l.onUserLoaded) == null || b.call(l, c);
195
195
  }, v.userUnloaded = () => {
196
- var u;
197
- A.value = null, (u = i.onUserUnloaded) == null || u.call(i);
196
+ var c;
197
+ A.value = null, (c = l.onUserUnloaded) == null || c.call(l);
198
198
  }, v.accessTokenExpired = () => {
199
- var u;
200
- (u = i.onAccessTokenExpired) == null || u.call(i);
199
+ var c;
200
+ (c = l.onAccessTokenExpired) == null || c.call(l);
201
201
  }, v.accessTokenExpiring = () => {
202
- var u;
203
- (u = i.onAccessTokenExpiring) == null || u.call(i);
204
- }, v.silentRenewError = async (u) => {
205
- console.warn("Silent renewal failed:", u);
202
+ var c;
203
+ (c = l.onAccessTokenExpiring) == null || c.call(l);
204
+ }, v.silentRenewError = async (c) => {
205
+ console.warn("Silent renewal failed:", c);
206
206
  try {
207
207
  await g.removeUser(), A.value = null;
208
- } catch (U) {
208
+ } catch (b) {
209
209
  console.error(
210
210
  "Failed to remove user after silent renewal error:",
211
- U
211
+ b
212
212
  );
213
213
  }
214
214
  f(
215
- u,
215
+ c,
216
216
  "Silent renewal failed",
217
217
  D,
218
- i.onError
218
+ l.onError
219
219
  );
220
220
  }, g.events.addUserLoaded(v.userLoaded), g.events.addUserUnloaded(v.userUnloaded), g.events.addAccessTokenExpired(
221
221
  v.accessTokenExpired
@@ -225,16 +225,16 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
225
225
  }, V = () => {
226
226
  Q(r), E.delete(w);
227
227
  };
228
- return !l.value && !a.value && (k(), O(r, e)), {
229
- user: o,
228
+ return !i.value && !n.value && (k(), O(r, e)), {
229
+ user: u,
230
230
  isAuthenticated: p,
231
- isLoading: n,
231
+ isLoading: a,
232
232
  error: s,
233
233
  accessToken: y,
234
234
  isExpired: d,
235
235
  signIn: h,
236
236
  signOut: q,
237
- silentRenew: x,
237
+ silentRenew: M,
238
238
  clearError: B,
239
239
  cleanup: V
240
240
  };
@@ -245,23 +245,30 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
245
245
  "Authentication not initialized. Make sure useAuth() is called in a parent component first."
246
246
  );
247
247
  return {
248
- processCallback: async (l) => {
249
- await z(e);
250
- const a = l || window.location.href, o = await e.userManager.signinRedirectCallback(a);
248
+ processCallback: async () => {
249
+ await x(e);
250
+ const n = await e.userManager.signinCallback();
251
+ if (!n)
252
+ throw new Error("Authentication callback failed: no user returned");
253
+ return {
254
+ user: n,
255
+ state: n.state
256
+ };
257
+ },
258
+ processLogoutCallback: async () => {
259
+ await x(e);
260
+ const n = await e.userManager.signoutCallback();
251
261
  return {
252
- user: o,
253
- state: o.state
262
+ state: n == null ? void 0 : n.state
254
263
  };
255
264
  },
256
- processSilentCallback: async (l) => {
257
- await z(e);
258
- const a = l || window.location.href;
259
- await e.userManager.signinSilentCallback(a);
265
+ processSilentCallback: async () => {
266
+ await x(e), await e.userManager.signinCallback();
260
267
  },
261
268
  isInitialized: e.isInitialized,
262
269
  isInitializing: e.isInitializing
263
270
  };
264
- }, ae = /* @__PURE__ */ M({
271
+ }, ae = /* @__PURE__ */ z({
265
272
  __name: "AuthCallback",
266
273
  props: {
267
274
  onSuccess: { type: Function },
@@ -269,25 +276,25 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
269
276
  },
270
277
  emits: ["success", "error"],
271
278
  setup(e, { emit: r }) {
272
- const t = e, l = r, { processCallback: a, isInitializing: o } = N(), n = m(!0), s = m(null), p = async () => {
279
+ const t = e, i = r, { processCallback: n, isInitializing: u } = N(), a = m(!0), s = m(null), p = async () => {
273
280
  var y, d;
274
281
  try {
275
- const w = await a();
276
- (y = t.onSuccess) == null || y.call(t, w.user, w.state), l("success", w.user, w.state);
282
+ const w = await n();
283
+ (y = t.onSuccess) == null || y.call(t, w.user, w.state), i("success", w.user, w.state);
277
284
  } catch (w) {
278
285
  const k = w instanceof Error ? w : new Error("Callback processing failed");
279
- s.value = k, (d = t.onError) == null || d.call(t, k), l("error", k);
286
+ s.value = k, (d = t.onError) == null || d.call(t, k), i("error", k);
280
287
  } finally {
281
- n.value = !1;
288
+ a.value = !1;
282
289
  }
283
290
  };
284
291
  return R(() => {
285
292
  p();
286
- }), (y, d) => (L(), _($, null, [
287
- (F(o) || n.value) && !s.value ? b(y.$slots, "default", { key: 0 }, () => [
293
+ }), (y, d) => (_(), L($, null, [
294
+ (F(u) || a.value) && !s.value ? C(y.$slots, "default", { key: 0 }, () => [
288
295
  d[0] || (d[0] = S("p", null, "Processing authentication...", -1))
289
- ]) : C("", !0),
290
- s.value ? b(y.$slots, "error", {
296
+ ]) : U("", !0),
297
+ s.value ? C(y.$slots, "error", {
291
298
  key: 1,
292
299
  error: s.value
293
300
  }, () => [
@@ -295,36 +302,36 @@ const E = /* @__PURE__ */ new Map(), Q = (e) => {
295
302
  d[1] || (d[1] = S("h2", null, "Authentication Error", -1)),
296
303
  S("p", null, P(s.value.message), 1)
297
304
  ])
298
- ]) : C("", !0)
305
+ ]) : U("", !0)
299
306
  ], 64));
300
307
  }
301
- }), se = /* @__PURE__ */ M({
308
+ }), se = /* @__PURE__ */ z({
302
309
  __name: "SilentCallback",
303
310
  props: {
304
311
  onError: { type: Function }
305
312
  },
306
313
  setup(e) {
307
- const r = e, { processSilentCallback: t, isInitializing: l } = N(), a = m(null), o = async () => {
308
- var n;
314
+ const r = e, { processSilentCallback: t, isInitializing: i } = N(), n = m(null), u = async () => {
315
+ var a;
309
316
  try {
310
317
  await t();
311
318
  } catch (s) {
312
319
  const p = s instanceof Error ? s : new Error("Silent callback processing failed");
313
- a.value = p, (n = r.onError) == null || n.call(r, p), console.error("Silent callback error:", p);
320
+ n.value = p, (a = r.onError) == null || a.call(r, p), console.error("Silent callback error:", p);
314
321
  }
315
322
  };
316
323
  return R(() => {
317
- o();
318
- }), (n, s) => (L(), _($, null, [
319
- F(l) && !a.value ? b(n.$slots, "default", { key: 0 }, () => [
324
+ u();
325
+ }), (a, s) => (_(), L($, null, [
326
+ F(i) && !n.value ? C(a.$slots, "default", { key: 0 }, () => [
320
327
  s[0] || (s[0] = S("p", null, "Processing silent renewal...", -1))
321
- ]) : C("", !0),
322
- a.value ? b(n.$slots, "error", {
328
+ ]) : U("", !0),
329
+ n.value ? C(a.$slots, "error", {
323
330
  key: 1,
324
- error: a.value
331
+ error: n.value
325
332
  }, () => [
326
- S("p", null, "Silent renewal error: " + P(a.value.message), 1)
327
- ]) : C("", !0)
333
+ S("p", null, "Silent renewal error: " + P(n.value.message), 1)
334
+ ]) : U("", !0)
328
335
  ], 64));
329
336
  }
330
337
  });
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m.Vuethenticate={},m.Vue,m.OidcClientTs))})(this,function(m,t,U){"use strict";function z(e){const r=typeof window<"u"?window.location.origin:"";return{authority:e.authority,client_id:e.clientId,client_secret:e.clientSecret,client_authentication:e.clientAuthentication??"client_secret_basic",redirect_uri:e.redirectUri??`${r}/auth/callback`,scope:e.scope??"openid profile",response_type:e.responseType??"code",userStore:e.storage?new U.WebStorageStateStore({store:R(e.storage)}):void 0,automaticSilentRenew:e.automaticSilentRenew??!0,silent_redirect_uri:e.silentRedirectUri??`${r}/auth/silent-callback`,post_logout_redirect_uri:e.postLogoutRedirectUri??r,includeIdTokenInSilentRenew:!0,accessTokenExpiringNotificationTimeInSeconds:60}}function R(e){if(typeof window>"u")return A();switch(e){case"localStorage":return window.localStorage;case"sessionStorage":return window.sessionStorage;case"memory":return A();default:return window.localStorage}}function A(){const e=new Map;return{getItem:r=>e.get(r)??null,setItem:(r,n)=>e.set(r,n),removeItem:r=>e.delete(r),clear:()=>e.clear(),get length(){return e.size},key:r=>Array.from(e.keys())[r]??null}}const f=new Map,_=e=>{try{const{userManager:r,eventCallbacks:n}=e;n.userLoaded&&r.events.removeUserLoaded(n.userLoaded),n.userUnloaded&&r.events.removeUserUnloaded(n.userUnloaded),n.accessTokenExpired&&r.events.removeAccessTokenExpired(n.accessTokenExpired),n.accessTokenExpiring&&r.events.removeAccessTokenExpiring(n.accessTokenExpiring),n.silentRenewError&&r.events.removeSilentRenewError(n.silentRenewError),r.stopSilentRenew(),r.clearStaleState()}catch(r){console.warn("Error during UserManager cleanup:",r)}},T=e=>`${e.authority}_${e.clientId}`,L=()=>f.size===0?null:(f.size===1||console.warn("Multiple auth instances detected. Callback components may not work as expected. Consider using a single auth instance or specify config explicitly."),Array.from(f.values())[0]||null),V=e=>{const r=T(e),n=f.get(r);if(n)return n;const l=N(e),s=t.ref(!1),c=t.ref(!1),a=t.ref(null),i=t.ref(!1),k=t.ref(null),E=t.computed(()=>!!a.value&&!a.value.expired),w=t.computed(()=>{var S;return((S=a.value)==null?void 0:S.access_token)||null}),p=t.computed(()=>{var S;return!!((S=a.value)!=null&&S.expired)}),h={userManager:l,isInitialized:s,isInitializing:c,user:a,isLoading:i,error:k,isAuthenticated:E,accessToken:w,isExpired:p,eventCallbacks:{}};return f.set(r,h),h},N=e=>{const r=z(e);return new U.UserManager(r)},v=(e,r,n,l)=>{const s=e instanceof Error?e:new Error(r);return n.value=s,l==null||l(s),s},$=e=>{var r,n;if(!((r=e.authority)!=null&&r.trim()))throw new Error("AuthConfig: authority is required");if(!((n=e.clientId)!=null&&n.trim()))throw new Error("AuthConfig: clientId is required");try{new URL(e.authority)}catch{throw new Error("AuthConfig: authority must be a valid URL")}},I=async(e,r=1e4)=>{if(!e.isInitialized.value)return new Promise((n,l)=>{const s=setTimeout(()=>{l(new Error("Authentication initialization timeout"))},r),c=t.watch(e.isInitialized,a=>{a&&(clearTimeout(s),c(),n())},{immediate:!0})})},F=e=>{$(e);const r=V(e),{userManager:n,isInitialized:l,isInitializing:s,user:c,isLoading:a,error:i,isAuthenticated:k,accessToken:E,isExpired:w}=r,p=T(e),h=async()=>{if(!(s.value||l.value))try{s.value=!0,a.value=!0,i.value=null;const u=await n.getUser();if(u)if(!u.expired)c.value=u;else if(e.automaticSilentRenew!==!1)try{await x()}catch(o){console.warn("Silent renewal failed during initialization:",o),await n.removeUser(),c.value=null}else await n.removeUser(),c.value=null}catch(u){v(u,"Failed to initialize authentication",i,e.onError)}finally{a.value=!1,s.value=!1,l.value=!0}},S=async u=>{try{a.value=!0,i.value=null,await n.signinRedirect({state:u})}catch(o){v(o,"Sign in failed",i,e.onError)}finally{a.value=!1}},B=async u=>{try{a.value=!0,i.value=null,c.value=null,await n.signoutRedirect({state:u})}catch(o){v(o,"Sign out failed",i,e.onError)}finally{a.value=!1}},x=async()=>{try{a.value=!0,i.value=null;const u=await n.signinSilent();c.value=u}catch(u){throw v(u,"Silent renewal failed",i,e.onError)}finally{a.value=!1}},O=()=>{i.value=null},K=(u,o)=>{const{userManager:g,user:b,error:D,eventCallbacks:y}=u;y.userLoaded=d=>{var C;b.value=d,(C=o.onUserLoaded)==null||C.call(o,d)},y.userUnloaded=()=>{var d;b.value=null,(d=o.onUserUnloaded)==null||d.call(o)},y.accessTokenExpired=()=>{var d;(d=o.onAccessTokenExpired)==null||d.call(o)},y.accessTokenExpiring=()=>{var d;(d=o.onAccessTokenExpiring)==null||d.call(o)},y.silentRenewError=async d=>{console.warn("Silent renewal failed:",d);try{await g.removeUser(),b.value=null}catch(C){console.error("Failed to remove user after silent renewal error:",C)}v(d,"Silent renewal failed",D,o.onError)},g.events.addUserLoaded(y.userLoaded),g.events.addUserUnloaded(y.userUnloaded),g.events.addAccessTokenExpired(y.accessTokenExpired),g.events.addAccessTokenExpiring(y.accessTokenExpiring),g.events.addSilentRenewError(y.silentRenewError)},j=()=>{_(r),f.delete(p)};return!l.value&&!s.value&&(h(),K(r,e)),{user:c,isAuthenticated:k,isLoading:a,error:i,accessToken:E,isExpired:w,signIn:S,signOut:B,silentRenew:x,clearError:O,cleanup:j}},M=()=>{const e=L();if(!e)throw new Error("Authentication not initialized. Make sure useAuth() is called in a parent component first.");return{processCallback:async l=>{await I(e);const s=l||window.location.href,c=await e.userManager.signinRedirectCallback(s);return{user:c,state:c.state}},processSilentCallback:async l=>{await I(e);const s=l||window.location.href;await e.userManager.signinSilentCallback(s)},isInitialized:e.isInitialized,isInitializing:e.isInitializing}},P=t.defineComponent({__name:"AuthCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:r}){const n=e,l=r,{processCallback:s,isInitializing:c}=M(),a=t.ref(!0),i=t.ref(null),k=async()=>{var E,w;try{const p=await s();(E=n.onSuccess)==null||E.call(n,p.user,p.state),l("success",p.user,p.state)}catch(p){const h=p instanceof Error?p:new Error("Callback processing failed");i.value=h,(w=n.onError)==null||w.call(n,h),l("error",h)}finally{a.value=!1}};return t.onMounted(()=>{k()}),(E,w)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[(t.unref(c)||a.value)&&!i.value?t.renderSlot(E.$slots,"default",{key:0},()=>[w[0]||(w[0]=t.createElementVNode("p",null,"Processing authentication...",-1))]):t.createCommentVNode("",!0),i.value?t.renderSlot(E.$slots,"error",{key:1,error:i.value},()=>[t.createElementVNode("div",null,[w[1]||(w[1]=t.createElementVNode("h2",null,"Authentication Error",-1)),t.createElementVNode("p",null,t.toDisplayString(i.value.message),1)])]):t.createCommentVNode("",!0)],64))}}),q=t.defineComponent({__name:"SilentCallback",props:{onError:{type:Function}},setup(e){const r=e,{processSilentCallback:n,isInitializing:l}=M(),s=t.ref(null),c=async()=>{var a;try{await n()}catch(i){const k=i instanceof Error?i:new Error("Silent callback processing failed");s.value=k,(a=r.onError)==null||a.call(r,k),console.error("Silent callback error:",k)}};return t.onMounted(()=>{c()}),(a,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.unref(l)&&!s.value?t.renderSlot(a.$slots,"default",{key:0},()=>[i[0]||(i[0]=t.createElementVNode("p",null,"Processing silent renewal...",-1))]):t.createCommentVNode("",!0),s.value?t.renderSlot(a.$slots,"error",{key:1,error:s.value},()=>[t.createElementVNode("p",null,"Silent renewal error: "+t.toDisplayString(s.value.message),1)]):t.createCommentVNode("",!0)],64))}});m.AuthCallback=P,m.SilentCallback=q,m.useAuth=F,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
1
+ (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m.Vuethenticate={},m.Vue,m.OidcClientTs))})(this,function(m,t,A){"use strict";function z(e){const r=typeof window<"u"?window.location.origin:"";return{authority:e.authority,client_id:e.clientId,client_secret:e.clientSecret,client_authentication:e.clientAuthentication,redirect_uri:e.redirectUri??`${r}/auth/callback`,scope:e.scope??"openid profile",response_type:e.responseType??"code",userStore:e.storage?new A.WebStorageStateStore({store:R(e.storage)}):void 0,automaticSilentRenew:e.automaticSilentRenew??!0,silent_redirect_uri:e.silentRedirectUri??`${r}/auth/silent-callback`,post_logout_redirect_uri:e.postLogoutRedirectUri??`${r}/auth/logout-callback`,includeIdTokenInSilentRenew:!0,accessTokenExpiringNotificationTimeInSeconds:60}}function R(e){if(typeof window>"u")return T();switch(e){case"localStorage":return window.localStorage;case"sessionStorage":return window.sessionStorage;case"memory":return T();default:return window.localStorage}}function T(){const e=new Map;return{getItem:r=>e.get(r)??null,setItem:(r,n)=>e.set(r,n),removeItem:r=>e.delete(r),clear:()=>e.clear(),get length(){return e.size},key:r=>Array.from(e.keys())[r]??null}}const f=new Map,L=e=>{try{const{userManager:r,eventCallbacks:n}=e;n.userLoaded&&r.events.removeUserLoaded(n.userLoaded),n.userUnloaded&&r.events.removeUserUnloaded(n.userUnloaded),n.accessTokenExpired&&r.events.removeAccessTokenExpired(n.accessTokenExpired),n.accessTokenExpiring&&r.events.removeAccessTokenExpiring(n.accessTokenExpiring),n.silentRenewError&&r.events.removeSilentRenewError(n.silentRenewError),r.stopSilentRenew(),r.clearStaleState()}catch(r){console.warn("Error during UserManager cleanup:",r)}},I=e=>`${e.authority}_${e.clientId}`,_=()=>f.size===0?null:(f.size===1||console.warn("Multiple auth instances detected. Callback components may not work as expected. Consider using a single auth instance or specify config explicitly."),Array.from(f.values())[0]||null),V=e=>{const r=I(e),n=f.get(r);if(n)return n;const o=N(e),a=t.ref(!1),u=t.ref(!1),s=t.ref(null),i=t.ref(!1),k=t.ref(null),E=t.computed(()=>!!s.value&&!s.value.expired),w=t.computed(()=>{var g;return((g=s.value)==null?void 0:g.access_token)||null}),p=t.computed(()=>{var g;return!!((g=s.value)!=null&&g.expired)}),h={userManager:o,isInitialized:a,isInitializing:u,user:s,isLoading:i,error:k,isAuthenticated:E,accessToken:w,isExpired:p,eventCallbacks:{}};return f.set(r,h),h},N=e=>{const r=z(e);return new A.UserManager(r)},v=(e,r,n,o)=>{const a=e instanceof Error?e:new Error(r);return n.value=a,o==null||o(a),a},$=e=>{var r,n;if(!((r=e.authority)!=null&&r.trim()))throw new Error("AuthConfig: authority is required");if(!((n=e.clientId)!=null&&n.trim()))throw new Error("AuthConfig: clientId is required");try{new URL(e.authority)}catch{throw new Error("AuthConfig: authority must be a valid URL")}},b=async(e,r=1e4)=>{if(!e.isInitialized.value)return new Promise((n,o)=>{const a=setTimeout(()=>{o(new Error("Authentication initialization timeout"))},r),u=t.watch(e.isInitialized,s=>{s&&(clearTimeout(a),u(),n())},{immediate:!0})})},F=e=>{$(e);const r=V(e),{userManager:n,isInitialized:o,isInitializing:a,user:u,isLoading:s,error:i,isAuthenticated:k,accessToken:E,isExpired:w}=r,p=I(e),h=async()=>{if(!(a.value||o.value))try{a.value=!0,s.value=!0,i.value=null;const c=await n.getUser();if(c)if(!c.expired)u.value=c;else if(e.automaticSilentRenew!==!1)try{await x()}catch(l){console.warn("Silent renewal failed during initialization:",l),await n.removeUser(),u.value=null}else await n.removeUser(),u.value=null}catch(c){v(c,"Failed to initialize authentication",i,e.onError)}finally{s.value=!1,a.value=!1,o.value=!0}},g=async c=>{try{s.value=!0,i.value=null,await n.signinRedirect({state:c})}catch(l){v(l,"Sign in failed",i,e.onError)}finally{s.value=!1}},B=async c=>{try{s.value=!0,i.value=null,u.value=null,await n.signoutRedirect({state:c})}catch(l){v(l,"Sign out failed",i,e.onError)}finally{s.value=!1}},x=async()=>{try{s.value=!0,i.value=null;const c=await n.signinSilent();u.value=c}catch(c){throw v(c,"Silent renewal failed",i,e.onError)}finally{s.value=!1}},O=()=>{i.value=null},K=(c,l)=>{const{userManager:S,user:U,error:D,eventCallbacks:y}=c;y.userLoaded=d=>{var C;U.value=d,(C=l.onUserLoaded)==null||C.call(l,d)},y.userUnloaded=()=>{var d;U.value=null,(d=l.onUserUnloaded)==null||d.call(l)},y.accessTokenExpired=()=>{var d;(d=l.onAccessTokenExpired)==null||d.call(l)},y.accessTokenExpiring=()=>{var d;(d=l.onAccessTokenExpiring)==null||d.call(l)},y.silentRenewError=async d=>{console.warn("Silent renewal failed:",d);try{await S.removeUser(),U.value=null}catch(C){console.error("Failed to remove user after silent renewal error:",C)}v(d,"Silent renewal failed",D,l.onError)},S.events.addUserLoaded(y.userLoaded),S.events.addUserUnloaded(y.userUnloaded),S.events.addAccessTokenExpired(y.accessTokenExpired),S.events.addAccessTokenExpiring(y.accessTokenExpiring),S.events.addSilentRenewError(y.silentRenewError)},j=()=>{L(r),f.delete(p)};return!o.value&&!a.value&&(h(),K(r,e)),{user:u,isAuthenticated:k,isLoading:s,error:i,accessToken:E,isExpired:w,signIn:g,signOut:B,silentRenew:x,clearError:O,cleanup:j}},M=()=>{const e=_();if(!e)throw new Error("Authentication not initialized. Make sure useAuth() is called in a parent component first.");return{processCallback:async()=>{await b(e);const a=await e.userManager.signinCallback();if(!a)throw new Error("Authentication callback failed: no user returned");return{user:a,state:a.state}},processLogoutCallback:async()=>{await b(e);const a=await e.userManager.signoutCallback();return{state:a==null?void 0:a.state}},processSilentCallback:async()=>{await b(e),await e.userManager.signinCallback()},isInitialized:e.isInitialized,isInitializing:e.isInitializing}},P=t.defineComponent({__name:"AuthCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:r}){const n=e,o=r,{processCallback:a,isInitializing:u}=M(),s=t.ref(!0),i=t.ref(null),k=async()=>{var E,w;try{const p=await a();(E=n.onSuccess)==null||E.call(n,p.user,p.state),o("success",p.user,p.state)}catch(p){const h=p instanceof Error?p:new Error("Callback processing failed");i.value=h,(w=n.onError)==null||w.call(n,h),o("error",h)}finally{s.value=!1}};return t.onMounted(()=>{k()}),(E,w)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[(t.unref(u)||s.value)&&!i.value?t.renderSlot(E.$slots,"default",{key:0},()=>[w[0]||(w[0]=t.createElementVNode("p",null,"Processing authentication...",-1))]):t.createCommentVNode("",!0),i.value?t.renderSlot(E.$slots,"error",{key:1,error:i.value},()=>[t.createElementVNode("div",null,[w[1]||(w[1]=t.createElementVNode("h2",null,"Authentication Error",-1)),t.createElementVNode("p",null,t.toDisplayString(i.value.message),1)])]):t.createCommentVNode("",!0)],64))}}),q=t.defineComponent({__name:"SilentCallback",props:{onError:{type:Function}},setup(e){const r=e,{processSilentCallback:n,isInitializing:o}=M(),a=t.ref(null),u=async()=>{var s;try{await n()}catch(i){const k=i instanceof Error?i:new Error("Silent callback processing failed");a.value=k,(s=r.onError)==null||s.call(r,k),console.error("Silent callback error:",k)}};return t.onMounted(()=>{u()}),(s,i)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.unref(o)&&!a.value?t.renderSlot(s.$slots,"default",{key:0},()=>[i[0]||(i[0]=t.createElementVNode("p",null,"Processing silent renewal...",-1))]):t.createCommentVNode("",!0),a.value?t.renderSlot(s.$slots,"error",{key:1,error:a.value},()=>[t.createElementVNode("p",null,"Silent renewal error: "+t.toDisplayString(a.value.message),1)]):t.createCommentVNode("",!0)],64))}});m.AuthCallback=P,m.SilentCallback=q,m.useAuth=F,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
@@ -1,4 +1,4 @@
1
- import { Ref } from 'vue';
1
+ import { ComputedRef, Ref } from 'vue';
2
2
  import { User } from 'oidc-client-ts';
3
3
  export interface AuthConfig {
4
4
  authority: string;
@@ -20,11 +20,11 @@ export interface AuthConfig {
20
20
  }
21
21
  export interface AuthState {
22
22
  user: Ref<User | null>;
23
- isAuthenticated: Ref<boolean>;
24
23
  isLoading: Ref<boolean>;
25
24
  error: Ref<Error | null>;
26
- accessToken: Ref<string | null>;
27
- isExpired: Ref<boolean>;
25
+ isAuthenticated: ComputedRef<boolean>;
26
+ accessToken: ComputedRef<string | null>;
27
+ isExpired: ComputedRef<boolean>;
28
28
  }
29
29
  export interface AuthMethods<TState = unknown> {
30
30
  signIn: (state?: TState) => Promise<void>;
@@ -48,5 +48,9 @@ export interface AuthCallbackProps<TState = unknown> {
48
48
  export interface SilentCallbackProps {
49
49
  onError?: (error: Error) => void;
50
50
  }
51
+ export interface SignoutCallbackProps<TState = unknown> {
52
+ onSuccess?: (state?: TState) => void;
53
+ onError?: (error: Error) => void;
54
+ }
51
55
  export { User } from 'oidc-client-ts';
52
56
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,UAAU;IAEvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,CAAC;IAEpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,cAAc,GAAG,gBAAgB,GAAG,QAAQ,CAAC;IACvD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,E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AO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAED,MAAM,MAAM,aAAa,CAAC,MAAM,GAAG,OAAO,IAAI,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,OAAO;IAC/C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,GAAG,OAAO;IAClD,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACpC;AAED,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuethenticate",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "A Vue 3 authentication state management library using oidc-client-ts",
5
5
  "keywords": [
6
6
  "vue",