vuethenticate 0.1.10 → 0.1.12
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 +40 -0
- package/dist/composables/useAuth.d.ts.map +1 -1
- package/dist/index.esm.js +266 -224
- package/dist/index.umd.js +1 -1
- package/dist/types/auth.d.ts +2 -0
- package/dist/types/auth.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -229,6 +229,7 @@ The main composable for authentication state management.
|
|
229
229
|
| `onUserUnloaded` | `() => void` | Called when user is unloaded |
|
230
230
|
| `onAccessTokenExpired` | `() => void` | Called when access token expires |
|
231
231
|
| `onAccessTokenExpiring` | `() => void` | Called before access token expires |
|
232
|
+
| `onSilentRenewError` | `(error: Error) => void` | Called when silent token renewal fails (auth state is automatically reset) |
|
232
233
|
|
233
234
|
#### Returns
|
234
235
|
|
@@ -244,6 +245,7 @@ The main composable for authentication state management.
|
|
244
245
|
| `signOut` | `(state?: TState) => Promise<void>` | Sign out user with optional state |
|
245
246
|
| `silentRenew` | `() => Promise<void>` | Manually renew token |
|
246
247
|
| `clearError` | `() => void` | Clear current error |
|
248
|
+
| `resetAuthState` | `() => Promise<void>` | Manually reset authentication state by removing user and clearing reactive state |
|
247
249
|
| `cleanup` | `() => void` | Manual cleanup of UserManager resources (rarely needed) |
|
248
250
|
|
249
251
|
### `<AuthCallback>`
|
@@ -622,6 +624,44 @@ const auth = useAuth({
|
|
622
624
|
|
623
625
|
## Advanced Usage
|
624
626
|
|
627
|
+
### Manual Authentication State Reset
|
628
|
+
|
629
|
+
The `resetAuthState()` method provides a way to manually clear authentication state and remove the user from storage. This is useful for custom logout flows or error recovery scenarios.
|
630
|
+
|
631
|
+
```typescript
|
632
|
+
const auth = useAuth(config);
|
633
|
+
|
634
|
+
// Manually reset authentication state
|
635
|
+
await auth.resetAuthState();
|
636
|
+
|
637
|
+
// This will:
|
638
|
+
// - Remove user from storage
|
639
|
+
// - Clear reactive user state
|
640
|
+
// - Log the operation
|
641
|
+
// - Handle any errors that occur during removal
|
642
|
+
```
|
643
|
+
|
644
|
+
**Common use cases:**
|
645
|
+
- Custom logout flows that don't use the standard OAuth logout endpoint
|
646
|
+
- Error recovery when authentication state becomes corrupted
|
647
|
+
- Implementing "sign out from all devices" functionality
|
648
|
+
- Testing scenarios where you need to reset authentication state
|
649
|
+
|
650
|
+
### Error Handling and State Recovery
|
651
|
+
|
652
|
+
All callback components (`AuthCallback`, `LogoutCallback`, `SilentCallback`) now automatically handle errors by resetting authentication state. When an error occurs during callback processing:
|
653
|
+
|
654
|
+
1. The error is logged with appropriate details
|
655
|
+
2. Authentication state is automatically reset via `resetAuthState()`
|
656
|
+
3. The error is re-thrown for your application to handle
|
657
|
+
|
658
|
+
This ensures that failed authentication flows don't leave the application in an inconsistent state.
|
659
|
+
|
660
|
+
```typescript
|
661
|
+
// Callback components automatically handle errors and reset state
|
662
|
+
// No additional error handling required for state consistency
|
663
|
+
```
|
664
|
+
|
625
665
|
### Manual Cleanup
|
626
666
|
|
627
667
|
The `useAuth` composable includes a `cleanup()` function for manual resource cleanup. **This is rarely needed** as the library manages resources automatically.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/composables/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,sBAAsB,EACtB,aAAa,EAChB,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/composables/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,UAAU,EACV,sBAAsB,EACtB,aAAa,EAChB,MAAM,eAAe,CAAC;AA4RvB;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,OAAO,EACpC,QAAQ,UAAU,KACnB,aAAa,CAAC,MAAM,CAsQtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GACzB,MAAM,GAAG,OAAO,OACf,sBAAsB,CAAC,MAAM,CAgHjC,CAAC"}
|
package/dist/index.esm.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { ref as y, computed as
|
2
|
-
import { WebStorageStateStore as
|
3
|
-
var
|
4
|
-
const
|
1
|
+
import { ref as y, computed as V, watch as J, defineComponent as T, onMounted as z, createElementBlock as W, openBlock as B, Fragment as D, renderSlot as S, createCommentVNode as L, unref as M, createElementVNode as v, toDisplayString as x } from "vue";
|
2
|
+
import { WebStorageStateStore as Q, Log as f, UserManager as X } from "oidc-client-ts";
|
3
|
+
var E = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(E || {});
|
4
|
+
const G = {
|
5
5
|
error: (e, ...t) => console.error(e, ...t),
|
6
6
|
warn: (e, ...t) => console.warn(e, ...t),
|
7
7
|
info: (e, ...t) => console.info(e, ...t),
|
8
8
|
debug: (e, ...t) => console.debug(e, ...t)
|
9
|
-
},
|
9
|
+
}, Z = {
|
10
10
|
error: () => {
|
11
11
|
},
|
12
12
|
warn: () => {
|
@@ -15,7 +15,7 @@ const D = {
|
|
15
15
|
},
|
16
16
|
debug: () => {
|
17
17
|
}
|
18
|
-
},
|
18
|
+
}, ee = (e, t) => ({
|
19
19
|
error: t >= 1 ? e.error : () => {
|
20
20
|
},
|
21
21
|
warn: t >= 2 ? e.warn : () => {
|
@@ -25,9 +25,9 @@ const D = {
|
|
25
25
|
debug: t >= 4 ? e.debug : () => {
|
26
26
|
}
|
27
27
|
});
|
28
|
-
function
|
28
|
+
function te(e) {
|
29
29
|
const t = typeof window < "u" ? window.location.origin : "";
|
30
|
-
return
|
30
|
+
return ae(e), {
|
31
31
|
authority: e.authority,
|
32
32
|
client_id: e.clientId,
|
33
33
|
client_secret: e.clientSecret,
|
@@ -35,7 +35,7 @@ function Z(e) {
|
|
35
35
|
redirect_uri: e.redirectUri ?? `${t}/auth/callback`,
|
36
36
|
scope: e.scope ?? "openid profile",
|
37
37
|
response_type: e.responseType ?? "code",
|
38
|
-
userStore: e.storage ? new
|
38
|
+
userStore: e.storage ? new Q({ store: re(e.storage) }) : void 0,
|
39
39
|
automaticSilentRenew: e.automaticSilentRenew ?? !0,
|
40
40
|
silent_redirect_uri: e.silentRedirectUri ?? `${t}/auth/silent-callback`,
|
41
41
|
post_logout_redirect_uri: e.postLogoutRedirectUri ?? `${t}/auth/logout-callback`,
|
@@ -43,21 +43,21 @@ function Z(e) {
|
|
43
43
|
accessTokenExpiringNotificationTimeInSeconds: 60
|
44
44
|
};
|
45
45
|
}
|
46
|
-
function
|
46
|
+
function re(e) {
|
47
47
|
if (typeof window > "u")
|
48
|
-
return
|
48
|
+
return _();
|
49
49
|
switch (e) {
|
50
50
|
case "localStorage":
|
51
51
|
return window.localStorage;
|
52
52
|
case "sessionStorage":
|
53
53
|
return window.sessionStorage;
|
54
54
|
case "memory":
|
55
|
-
return
|
55
|
+
return _();
|
56
56
|
default:
|
57
57
|
return window.localStorage;
|
58
58
|
}
|
59
59
|
}
|
60
|
-
function
|
60
|
+
function _() {
|
61
61
|
const e = /* @__PURE__ */ new Map();
|
62
62
|
return {
|
63
63
|
getItem: (t) => e.get(t) ?? null,
|
@@ -70,32 +70,32 @@ function P() {
|
|
70
70
|
key: (t) => Array.from(e.keys())[t] ?? null
|
71
71
|
};
|
72
72
|
}
|
73
|
-
const
|
73
|
+
const ae = (e) => {
|
74
74
|
if (e.logLevel === void 0 && !e.logger)
|
75
75
|
return;
|
76
|
-
const t = e.logger ?? (e.logLevel !== void 0 ?
|
77
|
-
t && (
|
76
|
+
const t = e.logger ?? (e.logLevel !== void 0 ? G : void 0), r = e.logLevel ?? E.NONE;
|
77
|
+
t && (f.setLogger({
|
78
78
|
error: t.error,
|
79
79
|
warn: t.warn,
|
80
80
|
info: t.info,
|
81
81
|
debug: t.debug
|
82
|
-
}),
|
83
|
-
},
|
82
|
+
}), f.setLevel(ne(r)));
|
83
|
+
}, ne = (e) => {
|
84
84
|
switch (e) {
|
85
|
-
case
|
86
|
-
return
|
87
|
-
case
|
88
|
-
return
|
89
|
-
case
|
90
|
-
return
|
91
|
-
case
|
92
|
-
return
|
93
|
-
case
|
94
|
-
return
|
85
|
+
case E.NONE:
|
86
|
+
return f.NONE;
|
87
|
+
case E.ERROR:
|
88
|
+
return f.ERROR;
|
89
|
+
case E.WARN:
|
90
|
+
return f.WARN;
|
91
|
+
case E.INFO:
|
92
|
+
return f.INFO;
|
93
|
+
case E.DEBUG:
|
94
|
+
return f.DEBUG;
|
95
95
|
default:
|
96
|
-
return
|
96
|
+
return f.NONE;
|
97
97
|
}
|
98
|
-
}, A = /* @__PURE__ */ new Map(),
|
98
|
+
}, A = /* @__PURE__ */ new Map(), le = (e) => {
|
99
99
|
try {
|
100
100
|
const { userManager: t, eventCallbacks: r } = e;
|
101
101
|
r.userLoaded && t.events.removeUserLoaded(r.userLoaded), r.userUnloaded && t.events.removeUserUnloaded(r.userUnloaded), r.accessTokenExpired && t.events.removeAccessTokenExpired(
|
@@ -108,44 +108,46 @@ const te = (e) => {
|
|
108
108
|
} catch (t) {
|
109
109
|
console.warn("Error during UserManager cleanup:", t);
|
110
110
|
}
|
111
|
-
},
|
111
|
+
}, K = (e) => `${e.authority}_${e.clientId}`, se = () => A.size === 0 ? null : (A.size === 1 || console.warn(
|
112
112
|
"Multiple auth instances detected. Callback components may not work as expected. Consider using a single auth instance or specify config explicitly."
|
113
|
-
), Array.from(A.values())[0] || null),
|
114
|
-
const t =
|
113
|
+
), Array.from(A.values())[0] || null), oe = (e) => {
|
114
|
+
const t = K(e), r = A.get(t);
|
115
115
|
if (r)
|
116
116
|
return r;
|
117
|
-
const s =
|
117
|
+
const s = ie(e), a = y(!1), d = y(!1), n = y(null), l = y(!1), i = y(null), b = V(() => !!n.value && !n.value.expired), h = V(() => {
|
118
118
|
var m;
|
119
|
-
return ((m =
|
120
|
-
}),
|
119
|
+
return ((m = n.value) == null ? void 0 : m.access_token) || null;
|
120
|
+
}), u = V(() => {
|
121
121
|
var m;
|
122
|
-
return !!((m =
|
123
|
-
}),
|
122
|
+
return !!((m = n.value) != null && m.expired);
|
123
|
+
}), g = ue(e), k = {
|
124
124
|
userManager: s,
|
125
|
-
isInitialized:
|
126
|
-
isInitializing:
|
127
|
-
user:
|
125
|
+
isInitialized: a,
|
126
|
+
isInitializing: d,
|
127
|
+
user: n,
|
128
128
|
isLoading: l,
|
129
|
-
error:
|
129
|
+
error: i,
|
130
130
|
isAuthenticated: b,
|
131
|
-
accessToken:
|
132
|
-
isExpired:
|
133
|
-
logger:
|
131
|
+
accessToken: h,
|
132
|
+
isExpired: u,
|
133
|
+
logger: g,
|
134
134
|
eventCallbacks: {}
|
135
135
|
};
|
136
136
|
return A.set(t, k), k;
|
137
|
-
}, se = (e) => {
|
138
|
-
const t = Z(e);
|
139
|
-
return new J(t);
|
140
|
-
}, oe = (e) => {
|
141
|
-
if (!e.logger && !e.logLevel)
|
142
|
-
return Q;
|
143
|
-
const t = e.logger ?? D, r = e.logLevel ?? f.NONE;
|
144
|
-
return X(t, r);
|
145
|
-
}, U = (e, t, r, s) => {
|
146
|
-
const n = e instanceof Error ? e : new Error(t);
|
147
|
-
return r.value = n, s == null || s(n), n;
|
148
137
|
}, ie = (e) => {
|
138
|
+
const t = te(e);
|
139
|
+
return new X(t);
|
140
|
+
}, ue = (e) => {
|
141
|
+
if (!e.logger && !e.logLevel)
|
142
|
+
return Z;
|
143
|
+
const t = e.logger ?? G, r = e.logLevel ?? E.NONE;
|
144
|
+
return ee(t, r);
|
145
|
+
}, U = async (e) => {
|
146
|
+
await e.userManager.removeUser(), e.user.value = null;
|
147
|
+
}, C = (e, t, r, s) => {
|
148
|
+
const a = e instanceof Error ? e : new Error(t);
|
149
|
+
return r.value = a, s == null || s(a), a;
|
150
|
+
}, ce = (e) => {
|
149
151
|
var t, r;
|
150
152
|
if (!((t = e.authority) != null && t.trim()))
|
151
153
|
throw new Error("AuthConfig: authority is required");
|
@@ -156,42 +158,42 @@ const te = (e) => {
|
|
156
158
|
} catch {
|
157
159
|
throw new Error("AuthConfig: authority must be a valid URL");
|
158
160
|
}
|
159
|
-
},
|
161
|
+
}, N = async (e, t = 1e4) => {
|
160
162
|
if (!e.isInitialized.value)
|
161
163
|
return new Promise((r, s) => {
|
162
|
-
const
|
164
|
+
const a = setTimeout(() => {
|
163
165
|
s(new Error("Authentication initialization timeout"));
|
164
|
-
}, t),
|
166
|
+
}, t), d = J(
|
165
167
|
e.isInitialized,
|
166
|
-
(
|
167
|
-
|
168
|
+
(n) => {
|
169
|
+
n && (clearTimeout(a), d(), r());
|
168
170
|
},
|
169
171
|
{ immediate: !0 }
|
170
172
|
);
|
171
173
|
});
|
172
|
-
},
|
174
|
+
}, de = (e) => {
|
173
175
|
const t = window.location.href;
|
174
176
|
return !!(e.silentRedirectUri && t.startsWith(e.silentRedirectUri) || e.redirectUri && t.startsWith(e.redirectUri) || e.postLogoutRedirectUri && t.startsWith(e.postLogoutRedirectUri));
|
175
|
-
},
|
176
|
-
|
177
|
-
const t =
|
177
|
+
}, ke = (e) => {
|
178
|
+
ce(e);
|
179
|
+
const t = oe(e), {
|
178
180
|
userManager: r,
|
179
181
|
isInitialized: s,
|
180
|
-
isInitializing:
|
181
|
-
user:
|
182
|
-
isLoading:
|
182
|
+
isInitializing: a,
|
183
|
+
user: d,
|
184
|
+
isLoading: n,
|
183
185
|
error: l,
|
184
|
-
isAuthenticated:
|
186
|
+
isAuthenticated: i,
|
185
187
|
accessToken: b,
|
186
|
-
isExpired:
|
187
|
-
} = t,
|
188
|
-
if (!(
|
188
|
+
isExpired: h
|
189
|
+
} = t, u = K(e), g = async () => {
|
190
|
+
if (!(a.value || s.value))
|
189
191
|
try {
|
190
|
-
|
191
|
-
const
|
192
|
-
if (
|
193
|
-
if (!
|
194
|
-
|
192
|
+
a.value = !0, n.value = !0, l.value = null;
|
193
|
+
const o = await r.getUser();
|
194
|
+
if (o)
|
195
|
+
if (!o.expired)
|
196
|
+
d.value = o, t.logger.info(
|
195
197
|
"[Vuethenticate] useAuth: User restored from storage"
|
196
198
|
);
|
197
199
|
else if (e.automaticSilentRenew !== !1) {
|
@@ -199,160 +201,200 @@ const te = (e) => {
|
|
199
201
|
"[Vuethenticate] useAuth: Token expired, attempting silent renewal"
|
200
202
|
);
|
201
203
|
try {
|
202
|
-
await
|
203
|
-
} catch (
|
204
|
+
await F();
|
205
|
+
} catch (c) {
|
204
206
|
t.logger.warn(
|
205
207
|
"[Vuethenticate] useAuth: Silent renewal failed during initialization",
|
206
|
-
|
207
|
-
), await
|
208
|
+
c
|
209
|
+
), await U(t);
|
208
210
|
}
|
209
211
|
} else
|
210
|
-
await r.removeUser(),
|
212
|
+
await r.removeUser(), d.value = null;
|
211
213
|
s.value = !0;
|
212
|
-
} catch (
|
214
|
+
} catch (o) {
|
213
215
|
t.logger.error(
|
214
216
|
"[Vuethenticate] useAuth: Initialization failed",
|
215
|
-
|
216
|
-
),
|
217
|
-
|
217
|
+
o
|
218
|
+
), C(
|
219
|
+
o,
|
218
220
|
"Authentication initialization failed",
|
219
221
|
l,
|
220
222
|
e.onError
|
221
223
|
);
|
222
224
|
} finally {
|
223
|
-
|
225
|
+
a.value = !1, n.value = !1;
|
224
226
|
}
|
225
|
-
}, k = async (
|
227
|
+
}, k = async (o) => {
|
226
228
|
try {
|
227
|
-
|
228
|
-
} catch (
|
229
|
-
t.logger.error("[Vuethenticate] useAuth: Sign-in failed",
|
229
|
+
n.value = !0, l.value = null, t.logger.info("[Vuethenticate] useAuth: Starting sign-in flow"), await r.signinRedirect({ state: o });
|
230
|
+
} catch (c) {
|
231
|
+
t.logger.error("[Vuethenticate] useAuth: Sign-in failed", c), C(c, "Sign in failed", l, e.onError);
|
230
232
|
} finally {
|
231
|
-
|
233
|
+
n.value = !1;
|
232
234
|
}
|
233
|
-
}, m = async (
|
235
|
+
}, m = async (o) => {
|
234
236
|
try {
|
235
|
-
|
237
|
+
n.value = !0, l.value = null, d.value = null, t.logger.info(
|
236
238
|
"[Vuethenticate] useAuth: Starting sign-out flow"
|
237
|
-
), await r.signoutRedirect({ state:
|
238
|
-
} catch (
|
239
|
-
t.logger.error("[Vuethenticate] useAuth: Sign-out failed",
|
239
|
+
), await r.signoutRedirect({ state: o });
|
240
|
+
} catch (c) {
|
241
|
+
t.logger.error("[Vuethenticate] useAuth: Sign-out failed", c), C(c, "Sign out failed", l, e.onError);
|
240
242
|
} finally {
|
241
|
-
|
243
|
+
n.value = !1;
|
242
244
|
}
|
243
|
-
},
|
245
|
+
}, F = async () => {
|
244
246
|
try {
|
245
|
-
|
246
|
-
const
|
247
|
-
|
248
|
-
} catch (
|
249
|
-
throw
|
250
|
-
|
247
|
+
n.value = !0, l.value = null;
|
248
|
+
const o = await r.signinSilent();
|
249
|
+
d.value = o;
|
250
|
+
} catch (o) {
|
251
|
+
throw C(
|
252
|
+
o,
|
251
253
|
"Silent renewal failed",
|
252
254
|
l,
|
253
255
|
e.onError
|
254
256
|
);
|
255
257
|
} finally {
|
256
|
-
|
258
|
+
n.value = !1;
|
257
259
|
}
|
258
|
-
},
|
260
|
+
}, q = () => {
|
259
261
|
l.value = null;
|
260
|
-
},
|
261
|
-
|
262
|
+
}, Y = async () => {
|
263
|
+
try {
|
264
|
+
await U(t), t.logger.info(
|
265
|
+
"[Vuethenticate] useAuth: Authentication state reset"
|
266
|
+
);
|
267
|
+
} catch (o) {
|
268
|
+
t.logger.error(
|
269
|
+
"[Vuethenticate] useAuth: Failed to reset authentication state",
|
270
|
+
o
|
271
|
+
), C(
|
272
|
+
o,
|
273
|
+
"Failed to reset authentication state",
|
274
|
+
l,
|
275
|
+
e.onError
|
276
|
+
);
|
277
|
+
}
|
278
|
+
}, $ = (o, c) => {
|
279
|
+
const { userManager: R, user: P, error: H, eventCallbacks: p } = o;
|
262
280
|
p.userLoaded = (w) => {
|
263
|
-
var
|
264
|
-
|
281
|
+
var I;
|
282
|
+
P.value = w, (I = c.onUserLoaded) == null || I.call(c, w);
|
265
283
|
}, p.userUnloaded = () => {
|
266
284
|
var w;
|
267
|
-
|
285
|
+
P.value = null, (w = c.onUserUnloaded) == null || w.call(c);
|
268
286
|
}, p.accessTokenExpired = () => {
|
269
287
|
var w;
|
270
|
-
(w =
|
288
|
+
(w = c.onAccessTokenExpired) == null || w.call(c);
|
271
289
|
}, p.accessTokenExpiring = () => {
|
272
290
|
var w;
|
273
|
-
(w =
|
291
|
+
(w = c.onAccessTokenExpiring) == null || w.call(c);
|
274
292
|
}, p.silentRenewError = async (w) => {
|
275
|
-
|
293
|
+
o.logger.warn("Silent renewal failed:", w);
|
276
294
|
try {
|
277
|
-
await
|
278
|
-
} catch (
|
279
|
-
|
295
|
+
await U(o);
|
296
|
+
} catch (I) {
|
297
|
+
o.logger.error(
|
280
298
|
"Failed to remove user after silent renewal error:",
|
281
|
-
|
299
|
+
I
|
282
300
|
);
|
283
301
|
}
|
284
|
-
|
302
|
+
C(
|
285
303
|
w,
|
286
304
|
"Silent renewal failed",
|
287
|
-
|
288
|
-
|
305
|
+
H,
|
306
|
+
c.onSilentRenewError
|
289
307
|
);
|
290
|
-
},
|
308
|
+
}, R.events.addUserLoaded(p.userLoaded), R.events.addUserUnloaded(p.userUnloaded), R.events.addAccessTokenExpired(
|
291
309
|
p.accessTokenExpired
|
292
|
-
),
|
310
|
+
), R.events.addAccessTokenExpiring(
|
293
311
|
p.accessTokenExpiring
|
294
|
-
),
|
295
|
-
},
|
296
|
-
|
312
|
+
), R.events.addSilentRenewError(p.silentRenewError);
|
313
|
+
}, j = () => {
|
314
|
+
le(t), A.delete(u);
|
297
315
|
};
|
298
|
-
return !s.value && !
|
299
|
-
user:
|
300
|
-
isAuthenticated:
|
301
|
-
isLoading:
|
316
|
+
return !s.value && !a.value && !de(e) ? (g(), $(t, e)) : !s.value && !a.value && ($(t, e), s.value = !0), {
|
317
|
+
user: d,
|
318
|
+
isAuthenticated: i,
|
319
|
+
isLoading: n,
|
302
320
|
isInitialized: s,
|
303
321
|
error: l,
|
304
322
|
accessToken: b,
|
305
|
-
isExpired:
|
323
|
+
isExpired: h,
|
306
324
|
signIn: k,
|
307
325
|
signOut: m,
|
308
|
-
silentRenew:
|
309
|
-
clearError:
|
310
|
-
|
326
|
+
silentRenew: F,
|
327
|
+
clearError: q,
|
328
|
+
resetAuthState: Y,
|
329
|
+
cleanup: j
|
311
330
|
};
|
312
331
|
}, O = () => {
|
313
|
-
const e =
|
332
|
+
const e = se();
|
314
333
|
if (!e)
|
315
334
|
throw new Error(
|
316
335
|
"Authentication not initialized. Make sure useAuth() is called in a parent component first."
|
317
336
|
);
|
318
337
|
return {
|
319
338
|
processCallback: async () => {
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
339
|
+
try {
|
340
|
+
await N(e), e.logger.info(
|
341
|
+
"[Vuethenticate] useAuthCallbacks: Processing authentication callback"
|
342
|
+
);
|
343
|
+
const a = await e.userManager.signinCallback();
|
344
|
+
if (!a)
|
345
|
+
throw new Error(
|
346
|
+
"Authentication callback failed: no user returned"
|
347
|
+
);
|
348
|
+
return e.logger.info(
|
349
|
+
"[Vuethenticate] useAuthCallbacks: Authentication callback successful"
|
350
|
+
), {
|
351
|
+
user: a,
|
352
|
+
state: a.state
|
353
|
+
};
|
354
|
+
} catch (a) {
|
355
|
+
throw e.logger.error(
|
356
|
+
"[Vuethenticate] useAuthCallbacks: Authentication callback failed",
|
357
|
+
a
|
358
|
+
), await U(e), a;
|
359
|
+
}
|
332
360
|
},
|
333
361
|
processLogoutCallback: async () => {
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
362
|
+
try {
|
363
|
+
await N(e), e.logger.debug(
|
364
|
+
"[Vuethenticate] useAuthCallbacks: Processing logout callback"
|
365
|
+
);
|
366
|
+
const a = await e.userManager.signoutCallback();
|
367
|
+
return e.logger.info(
|
368
|
+
"[Vuethenticate] useAuthCallbacks: Logout callback completed successfully"
|
369
|
+
), {
|
370
|
+
state: a == null ? void 0 : a.userState
|
371
|
+
};
|
372
|
+
} catch (a) {
|
373
|
+
throw e.logger.error(
|
374
|
+
"[Vuethenticate] useAuthCallbacks: Logout callback failed",
|
375
|
+
a
|
376
|
+
), await U(e), a;
|
377
|
+
}
|
343
378
|
},
|
344
379
|
processSilentCallback: async () => {
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
380
|
+
try {
|
381
|
+
await N(e), e.logger.debug(
|
382
|
+
"[Vuethenticate] useAuthCallbacks: Processing silent callback"
|
383
|
+
), await e.userManager.signinCallback(), e.logger.debug(
|
384
|
+
"[Vuethenticate] useAuthCallbacks: Silent callback completed successfully"
|
385
|
+
);
|
386
|
+
} catch (a) {
|
387
|
+
throw e.logger.error(
|
388
|
+
"[Vuethenticate] useAuthCallbacks: Silent callback failed",
|
389
|
+
a
|
390
|
+
), await U(e), a;
|
391
|
+
}
|
350
392
|
},
|
351
393
|
isInitialized: e.isInitialized,
|
352
394
|
isInitializing: e.isInitializing,
|
353
395
|
logger: e.logger
|
354
396
|
};
|
355
|
-
},
|
397
|
+
}, we = /* @__PURE__ */ T({
|
356
398
|
__name: "AuthCallback",
|
357
399
|
props: {
|
358
400
|
onSuccess: { type: Function },
|
@@ -360,44 +402,44 @@ const te = (e) => {
|
|
360
402
|
},
|
361
403
|
emits: ["success", "error"],
|
362
404
|
setup(e, { emit: t }) {
|
363
|
-
const r = e, s = t, { processCallback:
|
364
|
-
var
|
405
|
+
const r = e, s = t, { processCallback: a, isInitializing: d, logger: n } = O(), l = y(!0), i = y(null), b = async () => {
|
406
|
+
var h, u;
|
365
407
|
try {
|
366
|
-
|
408
|
+
n.info(
|
367
409
|
"[Vuethenticate] AuthCallback: Processing authentication callback"
|
368
410
|
);
|
369
|
-
const
|
370
|
-
|
411
|
+
const g = await a();
|
412
|
+
n.info(
|
371
413
|
"[Vuethenticate] AuthCallback: Authentication callback completed successfully"
|
372
|
-
), (
|
373
|
-
} catch (
|
374
|
-
const k =
|
375
|
-
|
414
|
+
), (h = r.onSuccess) == null || h.call(r, g.user, g.state), s("success", g.user, g.state);
|
415
|
+
} catch (g) {
|
416
|
+
const k = g instanceof Error ? g : new Error("Callback processing failed");
|
417
|
+
n.error(
|
376
418
|
"[Vuethenticate] AuthCallback: Authentication callback failed",
|
377
419
|
k
|
378
|
-
),
|
420
|
+
), i.value = k, (u = r.onError) == null || u.call(r, k), s("error", k);
|
379
421
|
} finally {
|
380
422
|
l.value = !1;
|
381
423
|
}
|
382
424
|
};
|
383
425
|
return z(() => {
|
384
426
|
b();
|
385
|
-
}), (
|
386
|
-
(M(
|
387
|
-
|
388
|
-
]) :
|
389
|
-
|
427
|
+
}), (h, u) => (B(), W(D, null, [
|
428
|
+
(M(d) || l.value) && !i.value ? S(h.$slots, "default", { key: 0 }, () => [
|
429
|
+
u[0] || (u[0] = v("p", null, "Processing authentication...", -1))
|
430
|
+
]) : L("", !0),
|
431
|
+
i.value ? S(h.$slots, "error", {
|
390
432
|
key: 1,
|
391
|
-
error:
|
433
|
+
error: i.value
|
392
434
|
}, () => [
|
393
435
|
v("div", null, [
|
394
|
-
|
395
|
-
v("p", null, x(
|
436
|
+
u[1] || (u[1] = v("h2", null, "Authentication Error", -1)),
|
437
|
+
v("p", null, x(i.value.message), 1)
|
396
438
|
])
|
397
|
-
]) :
|
439
|
+
]) : L("", !0)
|
398
440
|
], 64));
|
399
441
|
}
|
400
|
-
}),
|
442
|
+
}), ve = /* @__PURE__ */ T({
|
401
443
|
__name: "LogoutCallback",
|
402
444
|
props: {
|
403
445
|
onSuccess: { type: Function },
|
@@ -405,86 +447,86 @@ const te = (e) => {
|
|
405
447
|
},
|
406
448
|
emits: ["success", "error"],
|
407
449
|
setup(e, { emit: t }) {
|
408
|
-
const r = e, s = t, { processLogoutCallback:
|
409
|
-
var
|
450
|
+
const r = e, s = t, { processLogoutCallback: a, isInitializing: d, logger: n } = O(), l = y(!0), i = y(null), b = async () => {
|
451
|
+
var h, u;
|
410
452
|
try {
|
411
|
-
|
453
|
+
n.info(
|
412
454
|
"[Vuethenticate] LogoutCallback: Processing logout callback"
|
413
455
|
);
|
414
|
-
const
|
415
|
-
|
456
|
+
const g = await a();
|
457
|
+
n.info(
|
416
458
|
"[Vuethenticate] LogoutCallback: Logout callback completed successfully"
|
417
|
-
), (
|
418
|
-
} catch (
|
419
|
-
const k =
|
420
|
-
|
459
|
+
), (h = r.onSuccess) == null || h.call(r, g.state), s("success", g.state);
|
460
|
+
} catch (g) {
|
461
|
+
const k = g instanceof Error ? g : new Error("Logout callback processing failed");
|
462
|
+
n.error(
|
421
463
|
"[Vuethenticate] LogoutCallback: Logout callback failed",
|
422
464
|
k
|
423
|
-
),
|
465
|
+
), i.value = k, (u = r.onError) == null || u.call(r, k), s("error", k);
|
424
466
|
} finally {
|
425
467
|
l.value = !1;
|
426
468
|
}
|
427
469
|
};
|
428
470
|
return z(() => {
|
429
471
|
b();
|
430
|
-
}), (
|
431
|
-
|
432
|
-
]) :
|
472
|
+
}), (h, u) => (M(d) || l.value) && !i.value ? S(h.$slots, "default", { key: 0 }, () => [
|
473
|
+
u[0] || (u[0] = v("p", null, "Processing logout...", -1))
|
474
|
+
]) : i.value ? S(h.$slots, "error", {
|
433
475
|
key: 1,
|
434
|
-
error:
|
476
|
+
error: i.value
|
435
477
|
}, () => [
|
436
478
|
v("div", null, [
|
437
|
-
|
438
|
-
v("p", null, x(
|
479
|
+
u[1] || (u[1] = v("h2", null, "Logout Error", -1)),
|
480
|
+
v("p", null, x(i.value.message), 1)
|
439
481
|
])
|
440
|
-
]) : S(
|
441
|
-
|
482
|
+
]) : S(h.$slots, "success", { key: 2 }, () => [
|
483
|
+
u[2] || (u[2] = v("div", null, [
|
442
484
|
v("h2", null, "Logout Successful"),
|
443
485
|
v("p", null, "You have been logged out successfully.")
|
444
486
|
], -1))
|
445
487
|
]);
|
446
488
|
}
|
447
|
-
}),
|
489
|
+
}), be = /* @__PURE__ */ T({
|
448
490
|
__name: "SilentCallback",
|
449
491
|
props: {
|
450
492
|
onError: { type: Function }
|
451
493
|
},
|
452
494
|
setup(e) {
|
453
|
-
const t = e, { processSilentCallback: r, isInitializing: s, logger:
|
495
|
+
const t = e, { processSilentCallback: r, isInitializing: s, logger: a } = O(), d = y(null), n = async () => {
|
454
496
|
var l;
|
455
497
|
try {
|
456
|
-
|
498
|
+
a.debug(
|
457
499
|
"[Vuethenticate] SilentCallback: Processing silent callback"
|
458
500
|
), await r();
|
459
|
-
} catch (
|
460
|
-
const b =
|
461
|
-
|
501
|
+
} catch (i) {
|
502
|
+
const b = i instanceof Error ? i : new Error("Silent callback processing failed");
|
503
|
+
a.error(
|
462
504
|
"[Vuethenticate] SilentCallback: Silent callback failed",
|
463
505
|
b
|
464
|
-
),
|
506
|
+
), d.value = b, (l = t.onError) == null || l.call(t, b);
|
465
507
|
}
|
466
508
|
};
|
467
509
|
return z(() => {
|
468
|
-
|
469
|
-
}), (l,
|
470
|
-
M(s) && !
|
471
|
-
|
472
|
-
]) :
|
473
|
-
|
510
|
+
n();
|
511
|
+
}), (l, i) => (B(), W(D, null, [
|
512
|
+
M(s) && !d.value ? S(l.$slots, "default", { key: 0 }, () => [
|
513
|
+
i[0] || (i[0] = v("p", null, "Processing silent renewal...", -1))
|
514
|
+
]) : L("", !0),
|
515
|
+
d.value ? S(l.$slots, "error", {
|
474
516
|
key: 1,
|
475
|
-
error:
|
517
|
+
error: d.value
|
476
518
|
}, () => [
|
477
|
-
v("p", null, "Silent renewal error: " + x(
|
478
|
-
]) :
|
519
|
+
v("p", null, "Silent renewal error: " + x(d.value.message), 1)
|
520
|
+
]) : L("", !0)
|
479
521
|
], 64));
|
480
522
|
}
|
481
523
|
});
|
482
524
|
export {
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
525
|
+
we as AuthCallback,
|
526
|
+
E as LogLevel,
|
527
|
+
ve as LogoutCallback,
|
528
|
+
be as SilentCallback,
|
529
|
+
G as consoleLogger,
|
530
|
+
Z as silentLogger,
|
531
|
+
ke as useAuth
|
490
532
|
};
|
package/dist/index.umd.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(f,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],r):(f=typeof globalThis<"u"?globalThis:f||self,r(f.Vuethenticate={},f.Vue,f.OidcClientTs))})(this,function(f,r,p){"use strict";var b=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(b||{});const V={error:(e,...t)=>console.error(e,...t),warn:(e,...t)=>console.warn(e,...t),info:(e,...t)=>console.info(e,...t),debug:(e,...t)=>console.debug(e,...t)},I={error:()=>{},warn:()=>{},info:()=>{},debug:()=>{}},x=(e,t)=>({error:t>=1?e.error:()=>{},warn:t>=2?e.warn:()=>{},info:t>=3?e.info:()=>{},debug:t>=4?e.debug:()=>{}});function $(e){const t=typeof window<"u"?window.location.origin:"";return P(e),{authority:e.authority,client_id:e.clientId,client_secret:e.clientSecret,client_authentication:e.clientAuthentication,redirect_uri:e.redirectUri??`${t}/auth/callback`,scope:e.scope??"openid profile",response_type:e.responseType??"code",userStore:e.storage?new p.WebStorageStateStore({store:F(e.storage)}):void 0,automaticSilentRenew:e.automaticSilentRenew??!0,silent_redirect_uri:e.silentRedirectUri??`${t}/auth/silent-callback`,post_logout_redirect_uri:e.postLogoutRedirectUri??`${t}/auth/logout-callback`,includeIdTokenInSilentRenew:!0,accessTokenExpiringNotificationTimeInSeconds:60}}function F(e){if(typeof window>"u")return M();switch(e){case"localStorage":return window.localStorage;case"sessionStorage":return window.sessionStorage;case"memory":return M();default:return window.localStorage}}function M(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>e.set(t,n),removeItem:t=>e.delete(t),clear:()=>e.clear(),get length(){return e.size},key:t=>Array.from(e.keys())[t]??null}}const P=e=>{if(e.logLevel===void 0&&!e.logger)return;const t=e.logger??(e.logLevel!==void 0?V:void 0),n=e.logLevel??b.NONE;t&&(p.Log.setLogger({error:t.error,warn:t.warn,info:t.info,debug:t.debug}),p.Log.setLevel(_(n)))},_=e=>{switch(e){case b.NONE:return p.Log.NONE;case b.ERROR:return p.Log.ERROR;case b.WARN:return p.Log.WARN;case b.INFO:return p.Log.INFO;case b.DEBUG:return p.Log.DEBUG;default:return p.Log.NONE}},S=new Map,B=e=>{try{const{userManager:t,eventCallbacks:n}=e;n.userLoaded&&t.events.removeUserLoaded(n.userLoaded),n.userUnloaded&&t.events.removeUserUnloaded(n.userUnloaded),n.accessTokenExpired&&t.events.removeAccessTokenExpired(n.accessTokenExpired),n.accessTokenExpiring&&t.events.removeAccessTokenExpiring(n.accessTokenExpiring),n.silentRenewError&&t.events.removeSilentRenewError(n.silentRenewError),t.stopSilentRenew(),t.clearStaleState()}catch(t){console.warn("Error during UserManager cleanup:",t)}},z=e=>`${e.authority}_${e.clientId}`,W=()=>S.size===0?null:(S.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(S.values())[0]||null),D=e=>{const t=z(e),n=S.get(t);if(n)return n;const s=q(e),a=r.ref(!1),d=r.ref(!1),l=r.ref(null),o=r.ref(!1),i=r.ref(null),E=r.computed(()=>!!l.value&&!l.value.expired),h=r.computed(()=>{var A;return((A=l.value)==null?void 0:A.access_token)||null}),c=r.computed(()=>{var A;return!!((A=l.value)!=null&&A.expired)}),g=G(e),w={userManager:s,isInitialized:a,isInitializing:d,user:l,isLoading:o,error:i,isAuthenticated:E,accessToken:h,isExpired:c,logger:g,eventCallbacks:{}};return S.set(t,w),w},q=e=>{const t=$(e);return new p.UserManager(t)},G=e=>{if(!e.logger&&!e.logLevel)return I;const t=e.logger??V,n=e.logLevel??b.NONE;return x(t,n)},U=(e,t,n,s)=>{const a=e instanceof Error?e:new Error(t);return n.value=a,s==null||s(a),a},K=e=>{var t,n;if(!((t=e.authority)!=null&&t.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")}},N=async(e,t=1e4)=>{if(!e.isInitialized.value)return new Promise((n,s)=>{const a=setTimeout(()=>{s(new Error("Authentication initialization timeout"))},t),d=r.watch(e.isInitialized,l=>{l&&(clearTimeout(a),d(),n())},{immediate:!0})})},j=e=>{const t=window.location.href;return!!(e.silentRedirectUri&&t.startsWith(e.silentRedirectUri)||e.redirectUri&&t.startsWith(e.redirectUri)||e.postLogoutRedirectUri&&t.startsWith(e.postLogoutRedirectUri))},Y=e=>{K(e);const t=D(e),{userManager:n,isInitialized:s,isInitializing:a,user:d,isLoading:l,error:o,isAuthenticated:i,accessToken:E,isExpired:h}=t,c=z(e),g=async()=>{if(!(a.value||s.value))try{a.value=!0,l.value=!0,o.value=null;const k=await n.getUser();if(k)if(!k.expired)d.value=k,t.logger.info("[Vuethenticate] useAuth: User restored from storage");else if(e.automaticSilentRenew!==!1){t.logger.info("[Vuethenticate] useAuth: Token expired, attempting silent renewal");try{await O()}catch(u){t.logger.warn("[Vuethenticate] useAuth: Silent renewal failed during initialization",u),await n.removeUser(),d.value=null}}else await n.removeUser(),d.value=null;s.value=!0}catch(k){t.logger.error("[Vuethenticate] useAuth: Initialization failed",k),U(k,"Authentication initialization failed",o,e.onError)}finally{a.value=!1,l.value=!1}},w=async k=>{try{l.value=!0,o.value=null,t.logger.info("[Vuethenticate] useAuth: Starting sign-in flow"),await n.signinRedirect({state:k})}catch(u){t.logger.error("[Vuethenticate] useAuth: Sign-in failed",u),U(u,"Sign in failed",o,e.onError)}finally{l.value=!1}},A=async k=>{try{l.value=!0,o.value=null,d.value=null,t.logger.info("[Vuethenticate] useAuth: Starting sign-out flow"),await n.signoutRedirect({state:k})}catch(u){t.logger.error("[Vuethenticate] useAuth: Sign-out failed",u),U(u,"Sign out failed",o,e.onError)}finally{l.value=!1}},O=async()=>{try{l.value=!0,o.value=null;const k=await n.signinSilent();d.value=k}catch(k){throw U(k,"Silent renewal failed",o,e.onError)}finally{l.value=!1}},X=()=>{o.value=null},T=(k,u)=>{const{userManager:C,user:R,error:ee,eventCallbacks:y}=k;y.userLoaded=m=>{var v;R.value=m,(v=u.onUserLoaded)==null||v.call(u,m)},y.userUnloaded=()=>{var m;R.value=null,(m=u.onUserUnloaded)==null||m.call(u)},y.accessTokenExpired=()=>{var m;(m=u.onAccessTokenExpired)==null||m.call(u)},y.accessTokenExpiring=()=>{var m;(m=u.onAccessTokenExpiring)==null||m.call(u)},y.silentRenewError=async m=>{console.warn("Silent renewal failed:",m);try{await C.removeUser(),R.value=null}catch(v){console.error("Failed to remove user after silent renewal error:",v)}U(m,"Silent renewal failed",ee,u.onError)},C.events.addUserLoaded(y.userLoaded),C.events.addUserUnloaded(y.userUnloaded),C.events.addAccessTokenExpired(y.accessTokenExpired),C.events.addAccessTokenExpiring(y.accessTokenExpiring),C.events.addSilentRenewError(y.silentRenewError)},Z=()=>{B(t),S.delete(c)};return!s.value&&!a.value&&!j(e)?(g(),T(t,e)):!s.value&&!a.value&&(T(t,e),s.value=!0),{user:d,isAuthenticated:i,isLoading:l,isInitialized:s,error:o,accessToken:E,isExpired:h,signIn:w,signOut:A,silentRenew:O,clearError:X,cleanup:Z}},L=()=>{const e=W();if(!e)throw new Error("Authentication not initialized. Make sure useAuth() is called in a parent component first.");return{processCallback:async()=>{await N(e),e.logger.info("[Vuethenticate] useAuthCallbacks: Processing authentication callback");const a=await e.userManager.signinCallback();if(!a)throw new Error("Authentication callback failed: no user returned");return e.logger.info("[Vuethenticate] useAuthCallbacks: Authentication callback successful"),{user:a,state:a.state}},processLogoutCallback:async()=>{await N(e),e.logger.debug("[Vuethenticate] useAuthCallbacks: Processing logout callback");const a=await e.userManager.signoutCallback();return e.logger.info("[Vuethenticate] useAuthCallbacks: Logout callback completed successfully"),{state:a==null?void 0:a.userState}},processSilentCallback:async()=>{await N(e),e.logger.debug("[Vuethenticate] useAuthCallbacks: Processing silent callback"),await e.userManager.signinCallback(),e.logger.debug("[Vuethenticate] useAuthCallbacks: Silent callback completed successfully")},isInitialized:e.isInitialized,isInitializing:e.isInitializing,logger:e.logger}},H=r.defineComponent({__name:"AuthCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:t}){const n=e,s=t,{processCallback:a,isInitializing:d,logger:l}=L(),o=r.ref(!0),i=r.ref(null),E=async()=>{var h,c;try{l.info("[Vuethenticate] AuthCallback: Processing authentication callback");const g=await a();l.info("[Vuethenticate] AuthCallback: Authentication callback completed successfully"),(h=n.onSuccess)==null||h.call(n,g.user,g.state),s("success",g.user,g.state)}catch(g){const w=g instanceof Error?g:new Error("Callback processing failed");l.error("[Vuethenticate] AuthCallback: Authentication callback failed",w),i.value=w,(c=n.onError)==null||c.call(n,w),s("error",w)}finally{o.value=!1}};return r.onMounted(()=>{E()}),(h,c)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.unref(d)||o.value)&&!i.value?r.renderSlot(h.$slots,"default",{key:0},()=>[c[0]||(c[0]=r.createElementVNode("p",null,"Processing authentication...",-1))]):r.createCommentVNode("",!0),i.value?r.renderSlot(h.$slots,"error",{key:1,error:i.value},()=>[r.createElementVNode("div",null,[c[1]||(c[1]=r.createElementVNode("h2",null,"Authentication Error",-1)),r.createElementVNode("p",null,r.toDisplayString(i.value.message),1)])]):r.createCommentVNode("",!0)],64))}}),J=r.defineComponent({__name:"LogoutCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:t}){const n=e,s=t,{processLogoutCallback:a,isInitializing:d,logger:l}=L(),o=r.ref(!0),i=r.ref(null),E=async()=>{var h,c;try{l.info("[Vuethenticate] LogoutCallback: Processing logout callback");const g=await a();l.info("[Vuethenticate] LogoutCallback: Logout callback completed successfully"),(h=n.onSuccess)==null||h.call(n,g.state),s("success",g.state)}catch(g){const w=g instanceof Error?g:new Error("Logout callback processing failed");l.error("[Vuethenticate] LogoutCallback: Logout callback failed",w),i.value=w,(c=n.onError)==null||c.call(n,w),s("error",w)}finally{o.value=!1}};return r.onMounted(()=>{E()}),(h,c)=>(r.unref(d)||o.value)&&!i.value?r.renderSlot(h.$slots,"default",{key:0},()=>[c[0]||(c[0]=r.createElementVNode("p",null,"Processing logout...",-1))]):i.value?r.renderSlot(h.$slots,"error",{key:1,error:i.value},()=>[r.createElementVNode("div",null,[c[1]||(c[1]=r.createElementVNode("h2",null,"Logout Error",-1)),r.createElementVNode("p",null,r.toDisplayString(i.value.message),1)])]):r.renderSlot(h.$slots,"success",{key:2},()=>[c[2]||(c[2]=r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Logout Successful"),r.createElementVNode("p",null,"You have been logged out successfully.")],-1))])}}),Q=r.defineComponent({__name:"SilentCallback",props:{onError:{type:Function}},setup(e){const t=e,{processSilentCallback:n,isInitializing:s,logger:a}=L(),d=r.ref(null),l=async()=>{var o;try{a.debug("[Vuethenticate] SilentCallback: Processing silent callback"),await n()}catch(i){const E=i instanceof Error?i:new Error("Silent callback processing failed");a.error("[Vuethenticate] SilentCallback: Silent callback failed",E),d.value=E,(o=t.onError)==null||o.call(t,E)}};return r.onMounted(()=>{l()}),(o,i)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(s)&&!d.value?r.renderSlot(o.$slots,"default",{key:0},()=>[i[0]||(i[0]=r.createElementVNode("p",null,"Processing silent renewal...",-1))]):r.createCommentVNode("",!0),d.value?r.renderSlot(o.$slots,"error",{key:1,error:d.value},()=>[r.createElementVNode("p",null,"Silent renewal error: "+r.toDisplayString(d.value.message),1)]):r.createCommentVNode("",!0)],64))}});f.AuthCallback=H,f.LogLevel=b,f.LogoutCallback=J,f.SilentCallback=Q,f.consoleLogger=V,f.silentLogger=I,f.useAuth=Y,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
1
|
+
(function(w,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],r):(w=typeof globalThis<"u"?globalThis:w||self,r(w.Vuethenticate={},w.Vue,w.OidcClientTs))})(this,function(w,r,b){"use strict";var p=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(p||{});const L={error:(e,...t)=>console.error(e,...t),warn:(e,...t)=>console.warn(e,...t),info:(e,...t)=>console.info(e,...t),debug:(e,...t)=>console.debug(e,...t)},I={error:()=>{},warn:()=>{},info:()=>{},debug:()=>{}},F=(e,t)=>({error:t>=1?e.error:()=>{},warn:t>=2?e.warn:()=>{},info:t>=3?e.info:()=>{},debug:t>=4?e.debug:()=>{}});function $(e){const t=typeof window<"u"?window.location.origin:"";return _(e),{authority:e.authority,client_id:e.clientId,client_secret:e.clientSecret,client_authentication:e.clientAuthentication,redirect_uri:e.redirectUri??`${t}/auth/callback`,scope:e.scope??"openid profile",response_type:e.responseType??"code",userStore:e.storage?new b.WebStorageStateStore({store:P(e.storage)}):void 0,automaticSilentRenew:e.automaticSilentRenew??!0,silent_redirect_uri:e.silentRedirectUri??`${t}/auth/silent-callback`,post_logout_redirect_uri:e.postLogoutRedirectUri??`${t}/auth/logout-callback`,includeIdTokenInSilentRenew:!0,accessTokenExpiringNotificationTimeInSeconds:60}}function P(e){if(typeof window>"u")return M();switch(e){case"localStorage":return window.localStorage;case"sessionStorage":return window.sessionStorage;case"memory":return M();default:return window.localStorage}}function M(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>e.set(t,n),removeItem:t=>e.delete(t),clear:()=>e.clear(),get length(){return e.size},key:t=>Array.from(e.keys())[t]??null}}const _=e=>{if(e.logLevel===void 0&&!e.logger)return;const t=e.logger??(e.logLevel!==void 0?L:void 0),n=e.logLevel??p.NONE;t&&(b.Log.setLogger({error:t.error,warn:t.warn,info:t.info,debug:t.debug}),b.Log.setLevel(B(n)))},B=e=>{switch(e){case p.NONE:return b.Log.NONE;case p.ERROR:return b.Log.ERROR;case p.WARN:return b.Log.WARN;case p.INFO:return b.Log.INFO;case p.DEBUG:return b.Log.DEBUG;default:return b.Log.NONE}},S=new Map,W=e=>{try{const{userManager:t,eventCallbacks:n}=e;n.userLoaded&&t.events.removeUserLoaded(n.userLoaded),n.userUnloaded&&t.events.removeUserUnloaded(n.userUnloaded),n.accessTokenExpired&&t.events.removeAccessTokenExpired(n.accessTokenExpired),n.accessTokenExpiring&&t.events.removeAccessTokenExpiring(n.accessTokenExpiring),n.silentRenewError&&t.events.removeSilentRenewError(n.silentRenewError),t.stopSilentRenew(),t.clearStaleState()}catch(t){console.warn("Error during UserManager cleanup:",t)}},z=e=>`${e.authority}_${e.clientId}`,D=()=>S.size===0?null:(S.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(S.values())[0]||null),q=e=>{const t=z(e),n=S.get(t);if(n)return n;const s=G(e),a=r.ref(!1),g=r.ref(!1),l=r.ref(null),o=r.ref(!1),c=r.ref(null),E=r.computed(()=>!!l.value&&!l.value.expired),k=r.computed(()=>{var A;return((A=l.value)==null?void 0:A.access_token)||null}),u=r.computed(()=>{var A;return!!((A=l.value)!=null&&A.expired)}),h=K(e),f={userManager:s,isInitialized:a,isInitializing:g,user:l,isLoading:o,error:c,isAuthenticated:E,accessToken:k,isExpired:u,logger:h,eventCallbacks:{}};return S.set(t,f),f},G=e=>{const t=$(e);return new b.UserManager(t)},K=e=>{if(!e.logger&&!e.logLevel)return I;const t=e.logger??L,n=e.logLevel??p.NONE;return F(t,n)},C=async e=>{await e.userManager.removeUser(),e.user.value=null},V=(e,t,n,s)=>{const a=e instanceof Error?e:new Error(t);return n.value=a,s==null||s(a),a},j=e=>{var t,n;if(!((t=e.authority)!=null&&t.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")}},N=async(e,t=1e4)=>{if(!e.isInitialized.value)return new Promise((n,s)=>{const a=setTimeout(()=>{s(new Error("Authentication initialization timeout"))},t),g=r.watch(e.isInitialized,l=>{l&&(clearTimeout(a),g(),n())},{immediate:!0})})},Y=e=>{const t=window.location.href;return!!(e.silentRedirectUri&&t.startsWith(e.silentRedirectUri)||e.redirectUri&&t.startsWith(e.redirectUri)||e.postLogoutRedirectUri&&t.startsWith(e.postLogoutRedirectUri))},H=e=>{j(e);const t=q(e),{userManager:n,isInitialized:s,isInitializing:a,user:g,isLoading:l,error:o,isAuthenticated:c,accessToken:E,isExpired:k}=t,u=z(e),h=async()=>{if(!(a.value||s.value))try{a.value=!0,l.value=!0,o.value=null;const i=await n.getUser();if(i)if(!i.expired)g.value=i,t.logger.info("[Vuethenticate] useAuth: User restored from storage");else if(e.automaticSilentRenew!==!1){t.logger.info("[Vuethenticate] useAuth: Token expired, attempting silent renewal");try{await O()}catch(d){t.logger.warn("[Vuethenticate] useAuth: Silent renewal failed during initialization",d),await C(t)}}else await n.removeUser(),g.value=null;s.value=!0}catch(i){t.logger.error("[Vuethenticate] useAuth: Initialization failed",i),V(i,"Authentication initialization failed",o,e.onError)}finally{a.value=!1,l.value=!1}},f=async i=>{try{l.value=!0,o.value=null,t.logger.info("[Vuethenticate] useAuth: Starting sign-in flow"),await n.signinRedirect({state:i})}catch(d){t.logger.error("[Vuethenticate] useAuth: Sign-in failed",d),V(d,"Sign in failed",o,e.onError)}finally{l.value=!1}},A=async i=>{try{l.value=!0,o.value=null,g.value=null,t.logger.info("[Vuethenticate] useAuth: Starting sign-out flow"),await n.signoutRedirect({state:i})}catch(d){t.logger.error("[Vuethenticate] useAuth: Sign-out failed",d),V(d,"Sign out failed",o,e.onError)}finally{l.value=!1}},O=async()=>{try{l.value=!0,o.value=null;const i=await n.signinSilent();g.value=i}catch(i){throw V(i,"Silent renewal failed",o,e.onError)}finally{l.value=!1}},Z=()=>{o.value=null},ee=async()=>{try{await C(t),t.logger.info("[Vuethenticate] useAuth: Authentication state reset")}catch(i){t.logger.error("[Vuethenticate] useAuth: Failed to reset authentication state",i),V(i,"Failed to reset authentication state",o,e.onError)}},T=(i,d)=>{const{userManager:U,user:x,error:re,eventCallbacks:y}=i;y.userLoaded=m=>{var v;x.value=m,(v=d.onUserLoaded)==null||v.call(d,m)},y.userUnloaded=()=>{var m;x.value=null,(m=d.onUserUnloaded)==null||m.call(d)},y.accessTokenExpired=()=>{var m;(m=d.onAccessTokenExpired)==null||m.call(d)},y.accessTokenExpiring=()=>{var m;(m=d.onAccessTokenExpiring)==null||m.call(d)},y.silentRenewError=async m=>{i.logger.warn("Silent renewal failed:",m);try{await C(i)}catch(v){i.logger.error("Failed to remove user after silent renewal error:",v)}V(m,"Silent renewal failed",re,d.onSilentRenewError)},U.events.addUserLoaded(y.userLoaded),U.events.addUserUnloaded(y.userUnloaded),U.events.addAccessTokenExpired(y.accessTokenExpired),U.events.addAccessTokenExpiring(y.accessTokenExpiring),U.events.addSilentRenewError(y.silentRenewError)},te=()=>{W(t),S.delete(u)};return!s.value&&!a.value&&!Y(e)?(h(),T(t,e)):!s.value&&!a.value&&(T(t,e),s.value=!0),{user:g,isAuthenticated:c,isLoading:l,isInitialized:s,error:o,accessToken:E,isExpired:k,signIn:f,signOut:A,silentRenew:O,clearError:Z,resetAuthState:ee,cleanup:te}},R=()=>{const e=D();if(!e)throw new Error("Authentication not initialized. Make sure useAuth() is called in a parent component first.");return{processCallback:async()=>{try{await N(e),e.logger.info("[Vuethenticate] useAuthCallbacks: Processing authentication callback");const a=await e.userManager.signinCallback();if(!a)throw new Error("Authentication callback failed: no user returned");return e.logger.info("[Vuethenticate] useAuthCallbacks: Authentication callback successful"),{user:a,state:a.state}}catch(a){throw e.logger.error("[Vuethenticate] useAuthCallbacks: Authentication callback failed",a),await C(e),a}},processLogoutCallback:async()=>{try{await N(e),e.logger.debug("[Vuethenticate] useAuthCallbacks: Processing logout callback");const a=await e.userManager.signoutCallback();return e.logger.info("[Vuethenticate] useAuthCallbacks: Logout callback completed successfully"),{state:a==null?void 0:a.userState}}catch(a){throw e.logger.error("[Vuethenticate] useAuthCallbacks: Logout callback failed",a),await C(e),a}},processSilentCallback:async()=>{try{await N(e),e.logger.debug("[Vuethenticate] useAuthCallbacks: Processing silent callback"),await e.userManager.signinCallback(),e.logger.debug("[Vuethenticate] useAuthCallbacks: Silent callback completed successfully")}catch(a){throw e.logger.error("[Vuethenticate] useAuthCallbacks: Silent callback failed",a),await C(e),a}},isInitialized:e.isInitialized,isInitializing:e.isInitializing,logger:e.logger}},J=r.defineComponent({__name:"AuthCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:t}){const n=e,s=t,{processCallback:a,isInitializing:g,logger:l}=R(),o=r.ref(!0),c=r.ref(null),E=async()=>{var k,u;try{l.info("[Vuethenticate] AuthCallback: Processing authentication callback");const h=await a();l.info("[Vuethenticate] AuthCallback: Authentication callback completed successfully"),(k=n.onSuccess)==null||k.call(n,h.user,h.state),s("success",h.user,h.state)}catch(h){const f=h instanceof Error?h:new Error("Callback processing failed");l.error("[Vuethenticate] AuthCallback: Authentication callback failed",f),c.value=f,(u=n.onError)==null||u.call(n,f),s("error",f)}finally{o.value=!1}};return r.onMounted(()=>{E()}),(k,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.unref(g)||o.value)&&!c.value?r.renderSlot(k.$slots,"default",{key:0},()=>[u[0]||(u[0]=r.createElementVNode("p",null,"Processing authentication...",-1))]):r.createCommentVNode("",!0),c.value?r.renderSlot(k.$slots,"error",{key:1,error:c.value},()=>[r.createElementVNode("div",null,[u[1]||(u[1]=r.createElementVNode("h2",null,"Authentication Error",-1)),r.createElementVNode("p",null,r.toDisplayString(c.value.message),1)])]):r.createCommentVNode("",!0)],64))}}),Q=r.defineComponent({__name:"LogoutCallback",props:{onSuccess:{type:Function},onError:{type:Function}},emits:["success","error"],setup(e,{emit:t}){const n=e,s=t,{processLogoutCallback:a,isInitializing:g,logger:l}=R(),o=r.ref(!0),c=r.ref(null),E=async()=>{var k,u;try{l.info("[Vuethenticate] LogoutCallback: Processing logout callback");const h=await a();l.info("[Vuethenticate] LogoutCallback: Logout callback completed successfully"),(k=n.onSuccess)==null||k.call(n,h.state),s("success",h.state)}catch(h){const f=h instanceof Error?h:new Error("Logout callback processing failed");l.error("[Vuethenticate] LogoutCallback: Logout callback failed",f),c.value=f,(u=n.onError)==null||u.call(n,f),s("error",f)}finally{o.value=!1}};return r.onMounted(()=>{E()}),(k,u)=>(r.unref(g)||o.value)&&!c.value?r.renderSlot(k.$slots,"default",{key:0},()=>[u[0]||(u[0]=r.createElementVNode("p",null,"Processing logout...",-1))]):c.value?r.renderSlot(k.$slots,"error",{key:1,error:c.value},()=>[r.createElementVNode("div",null,[u[1]||(u[1]=r.createElementVNode("h2",null,"Logout Error",-1)),r.createElementVNode("p",null,r.toDisplayString(c.value.message),1)])]):r.renderSlot(k.$slots,"success",{key:2},()=>[u[2]||(u[2]=r.createElementVNode("div",null,[r.createElementVNode("h2",null,"Logout Successful"),r.createElementVNode("p",null,"You have been logged out successfully.")],-1))])}}),X=r.defineComponent({__name:"SilentCallback",props:{onError:{type:Function}},setup(e){const t=e,{processSilentCallback:n,isInitializing:s,logger:a}=R(),g=r.ref(null),l=async()=>{var o;try{a.debug("[Vuethenticate] SilentCallback: Processing silent callback"),await n()}catch(c){const E=c instanceof Error?c:new Error("Silent callback processing failed");a.error("[Vuethenticate] SilentCallback: Silent callback failed",E),g.value=E,(o=t.onError)==null||o.call(t,E)}};return r.onMounted(()=>{l()}),(o,c)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(s)&&!g.value?r.renderSlot(o.$slots,"default",{key:0},()=>[c[0]||(c[0]=r.createElementVNode("p",null,"Processing silent renewal...",-1))]):r.createCommentVNode("",!0),g.value?r.renderSlot(o.$slots,"error",{key:1,error:g.value},()=>[r.createElementVNode("p",null,"Silent renewal error: "+r.toDisplayString(g.value.message),1)]):r.createCommentVNode("",!0)],64))}});w.AuthCallback=J,w.LogLevel=p,w.LogoutCallback=Q,w.SilentCallback=X,w.consoleLogger=L,w.silentLogger=I,w.useAuth=H,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/auth.d.ts
CHANGED
@@ -20,6 +20,7 @@ export interface AuthConfig {
|
|
20
20
|
onUserUnloaded?: () => void;
|
21
21
|
onAccessTokenExpired?: () => void;
|
22
22
|
onAccessTokenExpiring?: () => void;
|
23
|
+
onSilentRenewError?: (error: Error) => void;
|
23
24
|
}
|
24
25
|
export interface AuthState {
|
25
26
|
user: Ref<User | null>;
|
@@ -35,6 +36,7 @@ export interface AuthMethods<TState = unknown> {
|
|
35
36
|
signOut: (state?: TState) => Promise<void>;
|
36
37
|
silentRenew: () => Promise<void>;
|
37
38
|
clearError: () => void;
|
39
|
+
resetAuthState: () => Promise<void>;
|
38
40
|
cleanup: () => void;
|
39
41
|
}
|
40
42
|
export interface AuthCallbackMethods<TState = unknown> {
|
package/dist/types/auth.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,UAAU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