@drmhse/authos-react 0.1.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/index.js ADDED
@@ -0,0 +1,555 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var ssoSdk = require('@drmhse/sso-sdk');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/context.tsx
8
+ var AuthOSContext = react.createContext(null);
9
+ function AuthOSProvider({ config, children, client: externalClient }) {
10
+ const clientRef = react.useRef(null);
11
+ if (!clientRef.current) {
12
+ clientRef.current = externalClient ?? new ssoSdk.SsoClient(config);
13
+ }
14
+ const client = clientRef.current;
15
+ const [user, setUser] = react.useState(null);
16
+ const [organization, setOrganization] = react.useState(null);
17
+ const [isLoading, setIsLoading] = react.useState(true);
18
+ const refreshUser = react.useCallback(async () => {
19
+ try {
20
+ const profile = await client.user.getProfile();
21
+ setUser(profile);
22
+ } catch {
23
+ setUser(null);
24
+ }
25
+ }, [client]);
26
+ react.useEffect(() => {
27
+ const unsubscribe = client.onAuthStateChange(async (isAuthenticated) => {
28
+ if (isAuthenticated) {
29
+ try {
30
+ const profile = await client.user.getProfile();
31
+ setUser(profile);
32
+ } catch {
33
+ setUser(null);
34
+ }
35
+ } else {
36
+ setUser(null);
37
+ setOrganization(null);
38
+ }
39
+ setIsLoading(false);
40
+ });
41
+ return unsubscribe;
42
+ }, [client]);
43
+ const contextValue = react.useMemo(
44
+ () => ({
45
+ client,
46
+ user,
47
+ isAuthenticated: !!user,
48
+ isLoading,
49
+ organization,
50
+ setUser,
51
+ setOrganization,
52
+ refreshUser
53
+ }),
54
+ [client, user, isLoading, organization, refreshUser]
55
+ );
56
+ return /* @__PURE__ */ jsxRuntime.jsx(AuthOSContext.Provider, { value: contextValue, children });
57
+ }
58
+ function useAuthOSContext() {
59
+ const context = react.useContext(AuthOSContext);
60
+ if (!context) {
61
+ throw new Error("useAuthOSContext must be used within an AuthOSProvider");
62
+ }
63
+ return context;
64
+ }
65
+
66
+ // src/hooks/useAuthOS.ts
67
+ function useAuthOS() {
68
+ const { client, isLoading, isAuthenticated } = useAuthOSContext();
69
+ return { client, isLoading, isAuthenticated };
70
+ }
71
+
72
+ // src/hooks/useUser.ts
73
+ function useUser() {
74
+ const { user } = useAuthOSContext();
75
+ return user;
76
+ }
77
+ function useOrganization() {
78
+ const { client, organization, setOrganization, refreshUser } = useAuthOSContext();
79
+ const switchOrganization = react.useCallback(
80
+ async (slug) => {
81
+ const orgResponse = await client.organizations.get(slug);
82
+ setOrganization(orgResponse.organization);
83
+ await refreshUser();
84
+ },
85
+ [client, setOrganization, refreshUser]
86
+ );
87
+ return { organization, switchOrganization };
88
+ }
89
+ function usePermission(permission) {
90
+ const { user } = useAuthOSContext();
91
+ return react.useMemo(() => {
92
+ if (!user?.permissions) return false;
93
+ return user.permissions.includes(permission);
94
+ }, [user?.permissions, permission]);
95
+ }
96
+ function useAnyPermission(permissions) {
97
+ const { user } = useAuthOSContext();
98
+ return react.useMemo(() => {
99
+ if (!user?.permissions) return false;
100
+ return permissions.some((perm) => user.permissions.includes(perm));
101
+ }, [user?.permissions, permissions]);
102
+ }
103
+ function useAllPermissions(permissions) {
104
+ const { user } = useAuthOSContext();
105
+ return react.useMemo(() => {
106
+ if (!user?.permissions) return false;
107
+ return permissions.every((perm) => user.permissions.includes(perm));
108
+ }, [user?.permissions, permissions]);
109
+ }
110
+ var MFA_PREAUTH_EXPIRY = 300;
111
+ function SignIn({
112
+ onSuccess,
113
+ onError,
114
+ showForgotPassword = true,
115
+ showSignUp = true,
116
+ className
117
+ }) {
118
+ const { client, setUser } = useAuthOSContext();
119
+ const [state, setState] = react.useState("credentials");
120
+ const [email, setEmail] = react.useState("");
121
+ const [password, setPassword] = react.useState("");
122
+ const [mfaCode, setMfaCode] = react.useState("");
123
+ const [preauthToken, setPreauthToken] = react.useState("");
124
+ const [error, setError] = react.useState(null);
125
+ const [isLoading, setIsLoading] = react.useState(false);
126
+ const handleCredentialsSubmit = react.useCallback(
127
+ async (e) => {
128
+ e.preventDefault();
129
+ setError(null);
130
+ setIsLoading(true);
131
+ try {
132
+ const result = await client.auth.login({ email, password });
133
+ if (result.expires_in === MFA_PREAUTH_EXPIRY) {
134
+ setPreauthToken(result.access_token);
135
+ setState("mfa");
136
+ } else {
137
+ const profile = await client.user.getProfile();
138
+ setUser(profile);
139
+ onSuccess?.(profile);
140
+ }
141
+ } catch (err) {
142
+ const message = err instanceof ssoSdk.SsoApiError ? err.message : "Login failed";
143
+ setError(message);
144
+ onError?.(err instanceof Error ? err : new Error(message));
145
+ } finally {
146
+ setIsLoading(false);
147
+ }
148
+ },
149
+ [client, email, password, setUser, onSuccess, onError]
150
+ );
151
+ const handleMfaSubmit = react.useCallback(
152
+ async (e) => {
153
+ e.preventDefault();
154
+ setError(null);
155
+ setIsLoading(true);
156
+ try {
157
+ await client.auth.verifyMfa(preauthToken, mfaCode);
158
+ const profile = await client.user.getProfile();
159
+ setUser(profile);
160
+ onSuccess?.(profile);
161
+ } catch (err) {
162
+ const message = err instanceof ssoSdk.SsoApiError ? err.message : "Invalid MFA code";
163
+ setError(message);
164
+ onError?.(err instanceof Error ? err : new Error(message));
165
+ } finally {
166
+ setIsLoading(false);
167
+ }
168
+ },
169
+ [client, preauthToken, mfaCode, setUser, onSuccess, onError]
170
+ );
171
+ const handleBackToCredentials = react.useCallback(() => {
172
+ setState("credentials");
173
+ setMfaCode("");
174
+ setPreauthToken("");
175
+ setError(null);
176
+ }, []);
177
+ if (state === "mfa") {
178
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-signin": "", "data-state": "mfa", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleMfaSubmit, children: [
179
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "mfa-code", children: [
180
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-mfa-code", children: "Verification Code" }),
181
+ /* @__PURE__ */ jsxRuntime.jsx(
182
+ "input",
183
+ {
184
+ id: "authos-mfa-code",
185
+ type: "text",
186
+ inputMode: "numeric",
187
+ autoComplete: "one-time-code",
188
+ value: mfaCode,
189
+ onChange: (e) => setMfaCode(e.target.value),
190
+ placeholder: "Enter 6-digit code",
191
+ required: true,
192
+ disabled: isLoading
193
+ }
194
+ )
195
+ ] }),
196
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-authos-error": true, children: error }),
197
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: isLoading, "data-authos-submit": "", children: isLoading ? "Verifying..." : "Verify" }),
198
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: handleBackToCredentials, "data-authos-back": "", children: "Back to login" })
199
+ ] }) });
200
+ }
201
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-signin": "", "data-state": "credentials", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleCredentialsSubmit, children: [
202
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "email", children: [
203
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-email", children: "Email" }),
204
+ /* @__PURE__ */ jsxRuntime.jsx(
205
+ "input",
206
+ {
207
+ id: "authos-email",
208
+ type: "email",
209
+ autoComplete: "email",
210
+ value: email,
211
+ onChange: (e) => setEmail(e.target.value),
212
+ placeholder: "Enter your email",
213
+ required: true,
214
+ disabled: isLoading
215
+ }
216
+ )
217
+ ] }),
218
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "password", children: [
219
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-password", children: "Password" }),
220
+ /* @__PURE__ */ jsxRuntime.jsx(
221
+ "input",
222
+ {
223
+ id: "authos-password",
224
+ type: "password",
225
+ autoComplete: "current-password",
226
+ value: password,
227
+ onChange: (e) => setPassword(e.target.value),
228
+ placeholder: "Enter your password",
229
+ required: true,
230
+ disabled: isLoading
231
+ }
232
+ )
233
+ ] }),
234
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-authos-error": true, children: error }),
235
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: isLoading, "data-authos-submit": "", children: isLoading ? "Signing in..." : "Sign In" }),
236
+ showForgotPassword && /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/forgot-password", "data-authos-link": "forgot-password", children: "Forgot password?" }),
237
+ showSignUp && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-signup-prompt": true, children: [
238
+ "Don't have an account? ",
239
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/signup", "data-authos-link": "signup", children: "Sign up" })
240
+ ] })
241
+ ] }) });
242
+ }
243
+ function SignUp({ onSuccess, onError, orgSlug, showSignIn = true, className }) {
244
+ const { client } = useAuthOSContext();
245
+ const [email, setEmail] = react.useState("");
246
+ const [password, setPassword] = react.useState("");
247
+ const [confirmPassword, setConfirmPassword] = react.useState("");
248
+ const [error, setError] = react.useState(null);
249
+ const [isLoading, setIsLoading] = react.useState(false);
250
+ const [isSuccess, setIsSuccess] = react.useState(false);
251
+ const handleSubmit = react.useCallback(
252
+ async (e) => {
253
+ e.preventDefault();
254
+ setError(null);
255
+ if (password !== confirmPassword) {
256
+ setError("Passwords do not match");
257
+ return;
258
+ }
259
+ if (password.length < 8) {
260
+ setError("Password must be at least 8 characters");
261
+ return;
262
+ }
263
+ setIsLoading(true);
264
+ try {
265
+ await client.auth.register({
266
+ email,
267
+ password,
268
+ org_slug: orgSlug
269
+ });
270
+ setIsSuccess(true);
271
+ onSuccess?.();
272
+ } catch (err) {
273
+ const message = err instanceof ssoSdk.SsoApiError ? err.message : "Registration failed";
274
+ setError(message);
275
+ onError?.(err instanceof Error ? err : new Error(message));
276
+ } finally {
277
+ setIsLoading(false);
278
+ }
279
+ },
280
+ [client, email, password, confirmPassword, orgSlug, onSuccess, onError]
281
+ );
282
+ if (isSuccess) {
283
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-signup": true, "data-state": "success", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-success": true, children: [
284
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Check your email" }),
285
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
286
+ "We've sent a verification link to ",
287
+ email,
288
+ ". Please click the link to verify your account."
289
+ ] })
290
+ ] }) });
291
+ }
292
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-signup": true, "data-state": "form", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
293
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "email", children: [
294
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-signup-email", children: "Email" }),
295
+ /* @__PURE__ */ jsxRuntime.jsx(
296
+ "input",
297
+ {
298
+ id: "authos-signup-email",
299
+ type: "email",
300
+ autoComplete: "email",
301
+ value: email,
302
+ onChange: (e) => setEmail(e.target.value),
303
+ placeholder: "Enter your email",
304
+ required: true,
305
+ disabled: isLoading
306
+ }
307
+ )
308
+ ] }),
309
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "password", children: [
310
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-signup-password", children: "Password" }),
311
+ /* @__PURE__ */ jsxRuntime.jsx(
312
+ "input",
313
+ {
314
+ id: "authos-signup-password",
315
+ type: "password",
316
+ autoComplete: "new-password",
317
+ value: password,
318
+ onChange: (e) => setPassword(e.target.value),
319
+ placeholder: "Create a password",
320
+ required: true,
321
+ minLength: 8,
322
+ disabled: isLoading
323
+ }
324
+ )
325
+ ] }),
326
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-field": "confirm-password", children: [
327
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "authos-signup-confirm", children: "Confirm Password" }),
328
+ /* @__PURE__ */ jsxRuntime.jsx(
329
+ "input",
330
+ {
331
+ id: "authos-signup-confirm",
332
+ type: "password",
333
+ autoComplete: "new-password",
334
+ value: confirmPassword,
335
+ onChange: (e) => setConfirmPassword(e.target.value),
336
+ placeholder: "Confirm your password",
337
+ required: true,
338
+ disabled: isLoading
339
+ }
340
+ )
341
+ ] }),
342
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-authos-error": true, children: error }),
343
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: isLoading, "data-authos-submit": true, children: isLoading ? "Creating account..." : "Create Account" }),
344
+ showSignIn && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-signin-prompt": true, children: [
345
+ "Already have an account? ",
346
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/signin", "data-authos-link": "signin", children: "Sign in" })
347
+ ] })
348
+ ] }) });
349
+ }
350
+ function OrganizationSwitcher({ onSwitch, className, renderItem }) {
351
+ const { client, isAuthenticated } = useAuthOSContext();
352
+ const { organization: currentOrg, switchOrganization } = useOrganization();
353
+ const [organizations, setOrganizations] = react.useState([]);
354
+ const [isLoading, setIsLoading] = react.useState(true);
355
+ const [isOpen, setIsOpen] = react.useState(false);
356
+ const [isSwitching, setIsSwitching] = react.useState(false);
357
+ react.useEffect(() => {
358
+ if (!isAuthenticated) {
359
+ setOrganizations([]);
360
+ setIsLoading(false);
361
+ return;
362
+ }
363
+ const fetchOrganizations = async () => {
364
+ try {
365
+ const orgResponses = await client.organizations.list();
366
+ setOrganizations(orgResponses.map((r) => r.organization));
367
+ } catch {
368
+ setOrganizations([]);
369
+ } finally {
370
+ setIsLoading(false);
371
+ }
372
+ };
373
+ fetchOrganizations();
374
+ }, [client, isAuthenticated]);
375
+ const handleSwitch = react.useCallback(
376
+ async (org) => {
377
+ if (org.slug === currentOrg?.slug) {
378
+ setIsOpen(false);
379
+ return;
380
+ }
381
+ setIsSwitching(true);
382
+ try {
383
+ await switchOrganization(org.slug);
384
+ onSwitch?.(org);
385
+ setIsOpen(false);
386
+ } catch (err) {
387
+ console.error("Failed to switch organization:", err);
388
+ } finally {
389
+ setIsSwitching(false);
390
+ }
391
+ },
392
+ [currentOrg, switchOrganization, onSwitch]
393
+ );
394
+ if (!isAuthenticated) {
395
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-orgswitcher": true, "data-state": "signed-out", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-org-placeholder": true, children: "Not signed in" }) });
396
+ }
397
+ if (isLoading) {
398
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-orgswitcher": true, "data-state": "loading", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading..." }) });
399
+ }
400
+ if (organizations.length === 0) {
401
+ return null;
402
+ }
403
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-authos-orgswitcher": true, "data-state": isOpen ? "open" : "closed", children: [
404
+ /* @__PURE__ */ jsxRuntime.jsxs(
405
+ "button",
406
+ {
407
+ type: "button",
408
+ onClick: () => setIsOpen(!isOpen),
409
+ disabled: isSwitching,
410
+ "data-authos-org-trigger": true,
411
+ children: [
412
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-org-name": true, children: currentOrg?.name ?? "Select Organization" }),
413
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-org-chevron": true, "aria-hidden": "true", children: isOpen ? "\u25B2" : "\u25BC" })
414
+ ]
415
+ }
416
+ ),
417
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-authos-org-list": true, role: "listbox", children: organizations.map((org) => {
418
+ const isActive = org.slug === currentOrg?.slug;
419
+ if (renderItem) {
420
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { role: "option", "aria-selected": isActive, children: /* @__PURE__ */ jsxRuntime.jsx(
421
+ "button",
422
+ {
423
+ type: "button",
424
+ onClick: () => handleSwitch(org),
425
+ disabled: isSwitching,
426
+ children: renderItem(org, isActive)
427
+ }
428
+ ) }, org.id);
429
+ }
430
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { role: "option", "aria-selected": isActive, children: /* @__PURE__ */ jsxRuntime.jsxs(
431
+ "button",
432
+ {
433
+ type: "button",
434
+ onClick: () => handleSwitch(org),
435
+ disabled: isSwitching,
436
+ "data-authos-org-item": true,
437
+ "data-active": isActive,
438
+ children: [
439
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-org-item-name": true, children: org.name }),
440
+ isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-org-item-check": true, children: "\u2713" })
441
+ ]
442
+ }
443
+ ) }, org.id);
444
+ }) })
445
+ ] });
446
+ }
447
+ function UserButton({ className, showEmail = false, onLogout }) {
448
+ const { client, user, setUser, setOrganization } = useAuthOSContext();
449
+ const [isOpen, setIsOpen] = react.useState(false);
450
+ const [isLoggingOut, setIsLoggingOut] = react.useState(false);
451
+ const handleLogout = react.useCallback(async () => {
452
+ setIsLoggingOut(true);
453
+ try {
454
+ await client.auth.logout();
455
+ } catch {
456
+ } finally {
457
+ setUser(null);
458
+ setOrganization(null);
459
+ setIsLoggingOut(false);
460
+ setIsOpen(false);
461
+ onLogout?.();
462
+ }
463
+ }, [client, setUser, setOrganization, onLogout]);
464
+ if (!user) {
465
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-authos-userbutton": true, "data-state": "signed-out", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-user-placeholder": true, children: "Not signed in" }) });
466
+ }
467
+ const initials = user.email.split("@")[0].split(".").map((part) => part[0]?.toUpperCase() ?? "").slice(0, 2).join("");
468
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-authos-userbutton": true, "data-state": isOpen ? "open" : "closed", children: [
469
+ /* @__PURE__ */ jsxRuntime.jsxs(
470
+ "button",
471
+ {
472
+ type: "button",
473
+ onClick: () => setIsOpen(!isOpen),
474
+ disabled: isLoggingOut,
475
+ "data-authos-user-trigger": true,
476
+ children: [
477
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-user-avatar": true, "aria-hidden": "true", children: initials }),
478
+ showEmail && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-user-email": true, children: user.email })
479
+ ]
480
+ }
481
+ ),
482
+ isOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-user-menu": true, children: [
483
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-authos-user-info": true, children: [
484
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-user-email": true, children: user.email }),
485
+ user.is_platform_owner && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-authos-user-badge": true, children: "Platform Owner" })
486
+ ] }),
487
+ /* @__PURE__ */ jsxRuntime.jsx("hr", { "data-authos-divider": true }),
488
+ /* @__PURE__ */ jsxRuntime.jsx(
489
+ "button",
490
+ {
491
+ type: "button",
492
+ onClick: handleLogout,
493
+ disabled: isLoggingOut,
494
+ "data-authos-logout": true,
495
+ children: isLoggingOut ? "Signing out..." : "Sign out"
496
+ }
497
+ )
498
+ ] })
499
+ ] });
500
+ }
501
+ function Protect({ permission, role, fallback = null, children }) {
502
+ const { user, isLoading } = useAuthOSContext();
503
+ const hasPermission = usePermission(permission ?? "");
504
+ const renderContent = () => {
505
+ if (isLoading) {
506
+ return null;
507
+ }
508
+ if (!user) {
509
+ return fallback;
510
+ }
511
+ if (permission && !hasPermission) {
512
+ return fallback;
513
+ }
514
+ if (role) {
515
+ const userRoles = user.permissions.filter((p) => p.startsWith("role:")).map((p) => p.replace("role:", ""));
516
+ const roleHierarchy = ["member", "admin", "owner"];
517
+ const requiredRoleIndex = roleHierarchy.indexOf(role);
518
+ const hasRole = userRoles.some((userRole) => {
519
+ const userRoleIndex = roleHierarchy.indexOf(userRole);
520
+ return userRoleIndex >= requiredRoleIndex;
521
+ });
522
+ if (!hasRole) {
523
+ return fallback;
524
+ }
525
+ }
526
+ return children;
527
+ };
528
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-authos-protect": true, children: renderContent() });
529
+ }
530
+
531
+ Object.defineProperty(exports, "AuthErrorCodes", {
532
+ enumerable: true,
533
+ get: function () { return ssoSdk.AuthErrorCodes; }
534
+ });
535
+ Object.defineProperty(exports, "SsoApiError", {
536
+ enumerable: true,
537
+ get: function () { return ssoSdk.SsoApiError; }
538
+ });
539
+ Object.defineProperty(exports, "SsoClient", {
540
+ enumerable: true,
541
+ get: function () { return ssoSdk.SsoClient; }
542
+ });
543
+ exports.AuthOSProvider = AuthOSProvider;
544
+ exports.OrganizationSwitcher = OrganizationSwitcher;
545
+ exports.Protect = Protect;
546
+ exports.SignIn = SignIn;
547
+ exports.SignUp = SignUp;
548
+ exports.UserButton = UserButton;
549
+ exports.useAllPermissions = useAllPermissions;
550
+ exports.useAnyPermission = useAnyPermission;
551
+ exports.useAuthOS = useAuthOS;
552
+ exports.useAuthOSContext = useAuthOSContext;
553
+ exports.useOrganization = useOrganization;
554
+ exports.usePermission = usePermission;
555
+ exports.useUser = useUser;