@acl-identity/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.
@@ -0,0 +1,82 @@
1
+
2
+ > @acl-identity/react@0.1.0 build /Users/lanreyusuf/Developer/personal/acl-identity-sdk/packages/react
3
+ > tsup
4
+
5
+ ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
6
+
7
+ package.json:13:6:
8
+  13 │ "types": "./dist/index.d.ts"
9
+ ╵ ~~~~~~~
10
+
11
+ The "import" condition comes earlier and will be used for all "import" statements:
12
+
13
+ package.json:11:6:
14
+  11 │ "import": "./dist/index.js",
15
+ ╵ ~~~~~~~~
16
+
17
+ The "require" condition comes earlier and will be used for all "require" calls:
18
+
19
+ package.json:12:6:
20
+  12 │ "require": "./dist/index.cjs",
21
+ ╵ ~~~~~~~~~
22
+
23
+ CLI Building entry: {"index":"src/index.ts"}
24
+ CLI Using tsconfig: tsconfig.json
25
+ CLI tsup v8.5.1
26
+ CLI Using tsup config: /Users/lanreyusuf/Developer/personal/acl-identity-sdk/packages/react/tsup.config.ts
27
+ CLI Target: es2020
28
+ CLI Cleaning output folder
29
+ ESM Build start
30
+ CJS Build start
31
+
32
+  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 7:52:29 PM
33
+
34
+ package.json:13:6:
35
+  13 │ "types": "./dist/index.d.ts"
36
+ ╵ ~~~~~~~
37
+
38
+ The "import" condition comes earlier and will be used for all "import" statements:
39
+
40
+ package.json:11:6:
41
+  11 │ "import": "./dist/index.js",
42
+ ╵ ~~~~~~~~
43
+
44
+ The "require" condition comes earlier and will be used for all "require" calls:
45
+
46
+ package.json:12:6:
47
+  12 │ "require": "./dist/index.cjs",
48
+ ╵ ~~~~~~~~~
49
+
50
+
51
+
52
+
53
+  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 7:52:29 PM
54
+
55
+ package.json:13:6:
56
+  13 │ "types": "./dist/index.d.ts"
57
+ ╵ ~~~~~~~
58
+
59
+ The "import" condition comes earlier and will be used for all "import" statements:
60
+
61
+ package.json:11:6:
62
+  11 │ "import": "./dist/index.js",
63
+ ╵ ~~~~~~~~
64
+
65
+ The "require" condition comes earlier and will be used for all "require" calls:
66
+
67
+ package.json:12:6:
68
+  12 │ "require": "./dist/index.cjs",
69
+ ╵ ~~~~~~~~~
70
+
71
+
72
+
73
+ ESM dist/index.mjs 7.33 KB
74
+ ESM dist/index.mjs.map 18.09 KB
75
+ ESM âšĦ️ Build success in 78ms
76
+ CJS dist/index.js 8.65 KB
77
+ CJS dist/index.js.map 17.71 KB
78
+ CJS âšĦ️ Build success in 85ms
79
+ DTS Build start
80
+ DTS âšĦ️ Build success in 440ms
81
+ DTS dist/index.d.mts 4.58 KB
82
+ DTS dist/index.d.ts 4.58 KB
@@ -0,0 +1,121 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+ import { ACLBrowserClient } from '@acl-identity/browser';
4
+ export { ACLBrowserClient, ACLBrowserClientConfig } from '@acl-identity/browser';
5
+ import { UserClaims } from '@acl-identity/types';
6
+ export { OrgContext, UserClaims } from '@acl-identity/types';
7
+
8
+ interface AuthProviderProps {
9
+ client: ACLBrowserClient;
10
+ /** OAuth2 client_id — passed to buildAuthorizationUrl and silentRenew */
11
+ clientId: string;
12
+ /** Redirect URI registered with the auth server for the main auth flow */
13
+ redirectUri: string;
14
+ /** Organization slug for multi-tenant routing */
15
+ orgSlug?: string;
16
+ /** Space-separated OAuth2 scopes. Defaults to 'openid profile email' */
17
+ scopes?: string;
18
+ /**
19
+ * Redirect URI for silent token renewal via hidden iframe.
20
+ * Must be registered with the auth server. The page at this URI
21
+ * must render <SilentCallbackPage />.
22
+ */
23
+ silentRedirectUri?: string;
24
+ /**
25
+ * Called after the OAuth2 redirect callback is processed.
26
+ * Use this to navigate the user to their intended destination.
27
+ */
28
+ onRedirectCallback?: (appState?: unknown) => void;
29
+ children: ReactNode;
30
+ }
31
+ declare function AuthProvider({ client, clientId, redirectUri, orgSlug, scopes, silentRedirectUri, onRedirectCallback, children, }: AuthProviderProps): react.JSX.Element;
32
+
33
+ interface SignInOptions {
34
+ appState?: unknown;
35
+ }
36
+ interface SignOutOptions {
37
+ returnTo?: string;
38
+ revokeToken?: boolean;
39
+ }
40
+ interface AuthContextValue {
41
+ user: UserClaims | null;
42
+ isAuthenticated: boolean;
43
+ isLoading: boolean;
44
+ error: Error | null;
45
+ client: ACLBrowserClient;
46
+ clientId: string;
47
+ redirectUri: string;
48
+ orgSlug?: string;
49
+ scopes?: string;
50
+ signIn(options?: SignInOptions): Promise<void>;
51
+ signOut(options?: SignOutOptions): Promise<void>;
52
+ getAccessToken(): Promise<string | null>;
53
+ handleCallback(callbackUrl?: string): Promise<{
54
+ appState?: unknown;
55
+ }>;
56
+ }
57
+
58
+ declare function useAuth(): AuthContextValue;
59
+
60
+ interface SignInButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
61
+ appState?: unknown;
62
+ }
63
+ declare function SignInButton({ children, appState, onClick, ...props }: SignInButtonProps): react.JSX.Element;
64
+ interface SignOutButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
65
+ returnTo?: string;
66
+ revokeToken?: boolean;
67
+ }
68
+ declare function SignOutButton({ children, returnTo, revokeToken, onClick, ...props }: SignOutButtonProps): react.JSX.Element;
69
+
70
+ interface CallbackHandlerProps {
71
+ /** Called after tokens are stored and auth state is updated. Use this to navigate away. */
72
+ onSuccess?: (appState?: unknown) => void;
73
+ /** Called if the code exchange fails. */
74
+ onError?: (error: Error) => void;
75
+ /** Rendered while the code exchange is in progress. */
76
+ loading?: React.ReactNode;
77
+ }
78
+ /**
79
+ * Place this component on the route that matches your `redirectUri`.
80
+ * It reads the `?code=` and `?state=` from the URL, exchanges them for
81
+ * tokens, then calls `onSuccess`. The URL is cleaned up automatically.
82
+ *
83
+ * @example
84
+ * // app/callback/page.tsx
85
+ * 'use client';
86
+ * import { CallbackHandler } from '@acl-identity/react';
87
+ * import { useRouter } from 'next/navigation';
88
+ *
89
+ * export default function CallbackPage() {
90
+ * const router = useRouter();
91
+ * return (
92
+ * <CallbackHandler
93
+ * onSuccess={(appState) => router.replace(appState?.returnTo ?? '/dashboard')}
94
+ * onError={() => router.replace('/login?error=callback_failed')}
95
+ * />
96
+ * );
97
+ * }
98
+ */
99
+ declare function CallbackHandler({ onSuccess, onError, loading }: CallbackHandlerProps): react.JSX.Element;
100
+
101
+ /**
102
+ * Render this component (and nothing else) at the route matching your
103
+ * `silentRedirectUri`. It posts the current URL back to the parent window
104
+ * so the hidden iframe used by silent renew can complete the token exchange.
105
+ *
106
+ * The route must be registered as an allowed redirect URI on your OAuth client.
107
+ *
108
+ * @example
109
+ * // app/silent-callback/page.tsx (Next.js App Router)
110
+ * 'use client';
111
+ * import { SilentCallbackPage } from '@acl-identity/react';
112
+ * export default SilentCallbackPage;
113
+ *
114
+ * @example
115
+ * // pages/silent-callback.tsx (Next.js Pages Router)
116
+ * import { SilentCallbackPage } from '@acl-identity/react';
117
+ * export default SilentCallbackPage;
118
+ */
119
+ declare function SilentCallbackPage(): null;
120
+
121
+ export { type AuthContextValue, AuthProvider, type AuthProviderProps, CallbackHandler, type CallbackHandlerProps, SignInButton, type SignInButtonProps, type SignInOptions, SignOutButton, type SignOutButtonProps, type SignOutOptions, SilentCallbackPage, useAuth };
@@ -0,0 +1,121 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+ import { ACLBrowserClient } from '@acl-identity/browser';
4
+ export { ACLBrowserClient, ACLBrowserClientConfig } from '@acl-identity/browser';
5
+ import { UserClaims } from '@acl-identity/types';
6
+ export { OrgContext, UserClaims } from '@acl-identity/types';
7
+
8
+ interface AuthProviderProps {
9
+ client: ACLBrowserClient;
10
+ /** OAuth2 client_id — passed to buildAuthorizationUrl and silentRenew */
11
+ clientId: string;
12
+ /** Redirect URI registered with the auth server for the main auth flow */
13
+ redirectUri: string;
14
+ /** Organization slug for multi-tenant routing */
15
+ orgSlug?: string;
16
+ /** Space-separated OAuth2 scopes. Defaults to 'openid profile email' */
17
+ scopes?: string;
18
+ /**
19
+ * Redirect URI for silent token renewal via hidden iframe.
20
+ * Must be registered with the auth server. The page at this URI
21
+ * must render <SilentCallbackPage />.
22
+ */
23
+ silentRedirectUri?: string;
24
+ /**
25
+ * Called after the OAuth2 redirect callback is processed.
26
+ * Use this to navigate the user to their intended destination.
27
+ */
28
+ onRedirectCallback?: (appState?: unknown) => void;
29
+ children: ReactNode;
30
+ }
31
+ declare function AuthProvider({ client, clientId, redirectUri, orgSlug, scopes, silentRedirectUri, onRedirectCallback, children, }: AuthProviderProps): react.JSX.Element;
32
+
33
+ interface SignInOptions {
34
+ appState?: unknown;
35
+ }
36
+ interface SignOutOptions {
37
+ returnTo?: string;
38
+ revokeToken?: boolean;
39
+ }
40
+ interface AuthContextValue {
41
+ user: UserClaims | null;
42
+ isAuthenticated: boolean;
43
+ isLoading: boolean;
44
+ error: Error | null;
45
+ client: ACLBrowserClient;
46
+ clientId: string;
47
+ redirectUri: string;
48
+ orgSlug?: string;
49
+ scopes?: string;
50
+ signIn(options?: SignInOptions): Promise<void>;
51
+ signOut(options?: SignOutOptions): Promise<void>;
52
+ getAccessToken(): Promise<string | null>;
53
+ handleCallback(callbackUrl?: string): Promise<{
54
+ appState?: unknown;
55
+ }>;
56
+ }
57
+
58
+ declare function useAuth(): AuthContextValue;
59
+
60
+ interface SignInButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
61
+ appState?: unknown;
62
+ }
63
+ declare function SignInButton({ children, appState, onClick, ...props }: SignInButtonProps): react.JSX.Element;
64
+ interface SignOutButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
65
+ returnTo?: string;
66
+ revokeToken?: boolean;
67
+ }
68
+ declare function SignOutButton({ children, returnTo, revokeToken, onClick, ...props }: SignOutButtonProps): react.JSX.Element;
69
+
70
+ interface CallbackHandlerProps {
71
+ /** Called after tokens are stored and auth state is updated. Use this to navigate away. */
72
+ onSuccess?: (appState?: unknown) => void;
73
+ /** Called if the code exchange fails. */
74
+ onError?: (error: Error) => void;
75
+ /** Rendered while the code exchange is in progress. */
76
+ loading?: React.ReactNode;
77
+ }
78
+ /**
79
+ * Place this component on the route that matches your `redirectUri`.
80
+ * It reads the `?code=` and `?state=` from the URL, exchanges them for
81
+ * tokens, then calls `onSuccess`. The URL is cleaned up automatically.
82
+ *
83
+ * @example
84
+ * // app/callback/page.tsx
85
+ * 'use client';
86
+ * import { CallbackHandler } from '@acl-identity/react';
87
+ * import { useRouter } from 'next/navigation';
88
+ *
89
+ * export default function CallbackPage() {
90
+ * const router = useRouter();
91
+ * return (
92
+ * <CallbackHandler
93
+ * onSuccess={(appState) => router.replace(appState?.returnTo ?? '/dashboard')}
94
+ * onError={() => router.replace('/login?error=callback_failed')}
95
+ * />
96
+ * );
97
+ * }
98
+ */
99
+ declare function CallbackHandler({ onSuccess, onError, loading }: CallbackHandlerProps): react.JSX.Element;
100
+
101
+ /**
102
+ * Render this component (and nothing else) at the route matching your
103
+ * `silentRedirectUri`. It posts the current URL back to the parent window
104
+ * so the hidden iframe used by silent renew can complete the token exchange.
105
+ *
106
+ * The route must be registered as an allowed redirect URI on your OAuth client.
107
+ *
108
+ * @example
109
+ * // app/silent-callback/page.tsx (Next.js App Router)
110
+ * 'use client';
111
+ * import { SilentCallbackPage } from '@acl-identity/react';
112
+ * export default SilentCallbackPage;
113
+ *
114
+ * @example
115
+ * // pages/silent-callback.tsx (Next.js Pages Router)
116
+ * import { SilentCallbackPage } from '@acl-identity/react';
117
+ * export default SilentCallbackPage;
118
+ */
119
+ declare function SilentCallbackPage(): null;
120
+
121
+ export { type AuthContextValue, AuthProvider, type AuthProviderProps, CallbackHandler, type CallbackHandlerProps, SignInButton, type SignInButtonProps, type SignInOptions, SignOutButton, type SignOutButtonProps, type SignOutOptions, SilentCallbackPage, useAuth };
package/dist/index.js ADDED
@@ -0,0 +1,252 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/provider.tsx
2
+
3
+
4
+
5
+
6
+
7
+ var _react = require('react');
8
+ var _core = require('@acl-identity/core');
9
+
10
+ // src/context.ts
11
+
12
+ var AuthContext = _react.createContext.call(void 0, null);
13
+
14
+ // src/provider.tsx
15
+ var _jsxruntime = require('react/jsx-runtime');
16
+ var PKCE_KEY_PREFIX = "acl:pkce:";
17
+ function AuthProvider({
18
+ client,
19
+ clientId,
20
+ redirectUri,
21
+ orgSlug,
22
+ scopes,
23
+ silentRedirectUri,
24
+ onRedirectCallback,
25
+ children
26
+ }) {
27
+ const [state, setState] = _react.useState.call(void 0, {
28
+ user: null,
29
+ isAuthenticated: false,
30
+ isLoading: true,
31
+ error: null
32
+ });
33
+ const initialized = _react.useRef.call(void 0, false);
34
+ const syncAuthState = _react.useCallback.call(void 0, async () => {
35
+ const [user, isAuthenticated] = await Promise.all([
36
+ client.auth.parseCurrentUser(),
37
+ client.auth.isAuthenticated()
38
+ ]);
39
+ setState({ user, isAuthenticated, isLoading: false, error: null });
40
+ }, [client]);
41
+ const handleSilentRenew = _react.useCallback.call(void 0, async () => {
42
+ if (!silentRedirectUri) {
43
+ setState((s) => ({ ...s, isLoading: false }));
44
+ return;
45
+ }
46
+ try {
47
+ await client.auth.silentRenew(silentRedirectUri, clientId, { orgSlug, scope: scopes });
48
+ await syncAuthState();
49
+ } catch (e2) {
50
+ setState({ user: null, isAuthenticated: false, isLoading: false, error: null });
51
+ }
52
+ }, [client, silentRedirectUri, clientId, orgSlug, scopes, syncAuthState]);
53
+ _react.useEffect.call(void 0, () => {
54
+ if (initialized.current) return;
55
+ initialized.current = true;
56
+ const url = new URL(window.location.href);
57
+ const isCallbackUrl = url.searchParams.has("code") && url.searchParams.has("state");
58
+ if (isCallbackUrl) {
59
+ return;
60
+ }
61
+ client.auth.isAuthenticated().then((isAuth) => {
62
+ if (isAuth) {
63
+ syncAuthState();
64
+ } else {
65
+ handleSilentRenew();
66
+ }
67
+ });
68
+ }, []);
69
+ _react.useEffect.call(void 0, () => {
70
+ if (!state.user || !silentRedirectUri) return;
71
+ let timer;
72
+ client.auth.getAccessToken().then((token) => {
73
+ if (!token) return;
74
+ const expiresAtMs = _core.tokenExpiresAt.call(void 0, token);
75
+ if (!expiresAtMs) return;
76
+ const msUntilRenew = expiresAtMs - Date.now() - 3e4;
77
+ if (msUntilRenew <= 0) {
78
+ handleSilentRenew();
79
+ return;
80
+ }
81
+ timer = setTimeout(handleSilentRenew, msUntilRenew);
82
+ });
83
+ return () => clearTimeout(timer);
84
+ }, [state.user, silentRedirectUri, handleSilentRenew, client]);
85
+ const signIn = _react.useCallback.call(void 0,
86
+ async (options) => {
87
+ const { url, state: authState, codeVerifier } = await client.auth.buildAuthorizationUrl({
88
+ clientId,
89
+ redirectUri,
90
+ orgSlug,
91
+ scope: scopes
92
+ });
93
+ sessionStorage.setItem(
94
+ `${PKCE_KEY_PREFIX}${authState}`,
95
+ JSON.stringify({ codeVerifier, appState: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.appState]), () => ( null)) })
96
+ );
97
+ window.location.href = url;
98
+ },
99
+ [client, clientId, redirectUri, orgSlug, scopes]
100
+ );
101
+ const signOut = _react.useCallback.call(void 0,
102
+ async (options) => {
103
+ await client.auth.logout({ revokeToken: _optionalChain([options, 'optionalAccess', _2 => _2.revokeToken]) });
104
+ setState({ user: null, isAuthenticated: false, isLoading: false, error: null });
105
+ if (_optionalChain([options, 'optionalAccess', _3 => _3.returnTo])) {
106
+ window.location.href = options.returnTo;
107
+ }
108
+ },
109
+ [client]
110
+ );
111
+ const getAccessToken = _react.useCallback.call(void 0, () => client.auth.getAccessToken(), [client]);
112
+ const handleCallback = _react.useCallback.call(void 0,
113
+ async (callbackUrl) => {
114
+ const url = new URL(_nullishCoalesce(callbackUrl, () => ( window.location.href)));
115
+ const error = url.searchParams.get("error");
116
+ if (error) {
117
+ const desc = _nullishCoalesce(url.searchParams.get("error_description"), () => ( error));
118
+ const err = new Error(desc);
119
+ setState((s) => ({ ...s, error: err, isLoading: false }));
120
+ throw err;
121
+ }
122
+ const code = url.searchParams.get("code");
123
+ const authState = url.searchParams.get("state");
124
+ if (!code || !authState) {
125
+ const err = new Error("Missing code or state in callback URL");
126
+ setState((s) => ({ ...s, error: err, isLoading: false }));
127
+ throw err;
128
+ }
129
+ const stored = sessionStorage.getItem(`${PKCE_KEY_PREFIX}${authState}`);
130
+ if (!stored) {
131
+ const err = new Error("Auth session expired or state mismatch. Please sign in again.");
132
+ setState((s) => ({ ...s, error: err, isLoading: false }));
133
+ throw err;
134
+ }
135
+ const { codeVerifier, appState } = JSON.parse(stored);
136
+ sessionStorage.removeItem(`${PKCE_KEY_PREFIX}${authState}`);
137
+ await client.auth.exchangeCode(code, codeVerifier, redirectUri);
138
+ await syncAuthState();
139
+ _optionalChain([onRedirectCallback, 'optionalCall', _4 => _4(appState)]);
140
+ return { appState };
141
+ },
142
+ [client, redirectUri, syncAuthState, onRedirectCallback]
143
+ );
144
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
145
+ AuthContext.Provider,
146
+ {
147
+ value: {
148
+ ...state,
149
+ client,
150
+ clientId,
151
+ redirectUri,
152
+ orgSlug,
153
+ scopes,
154
+ signIn,
155
+ signOut,
156
+ getAccessToken,
157
+ handleCallback
158
+ },
159
+ children
160
+ }
161
+ );
162
+ }
163
+
164
+ // src/hooks/use-auth.ts
165
+
166
+ function useAuth() {
167
+ const ctx = _react.useContext.call(void 0, AuthContext);
168
+ if (!ctx) {
169
+ throw new Error(
170
+ "useAuth must be used within an <AuthProvider>. Wrap your app (or the relevant subtree) with <AuthProvider client={...} clientId={...} redirectUri={...} />."
171
+ );
172
+ }
173
+ return ctx;
174
+ }
175
+
176
+ // src/components/sign-in-button.tsx
177
+
178
+ function SignInButton({ children = "Sign in", appState, onClick, ...props }) {
179
+ const { signIn } = useAuth();
180
+ const handleClick = (e) => {
181
+ _optionalChain([onClick, 'optionalCall', _5 => _5(e)]);
182
+ if (!e.defaultPrevented) {
183
+ signIn({ appState });
184
+ }
185
+ };
186
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: handleClick, ...props, children });
187
+ }
188
+ function SignOutButton({
189
+ children = "Sign out",
190
+ returnTo,
191
+ revokeToken,
192
+ onClick,
193
+ ...props
194
+ }) {
195
+ const { signOut } = useAuth();
196
+ const handleClick = (e) => {
197
+ _optionalChain([onClick, 'optionalCall', _6 => _6(e)]);
198
+ if (!e.defaultPrevented) {
199
+ const options = {};
200
+ if (returnTo) options.returnTo = returnTo;
201
+ if (revokeToken !== void 0) options.revokeToken = revokeToken;
202
+ signOut(options);
203
+ }
204
+ };
205
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: handleClick, ...props, children });
206
+ }
207
+
208
+ // src/components/callback-handler.tsx
209
+
210
+
211
+ function CallbackHandler({ onSuccess, onError, loading = null }) {
212
+ const { handleCallback } = useAuth();
213
+ const called = _react.useRef.call(void 0, false);
214
+ _react.useEffect.call(void 0, () => {
215
+ if (called.current) return;
216
+ called.current = true;
217
+ handleCallback().then(({ appState }) => {
218
+ window.history.replaceState({}, document.title, window.location.pathname);
219
+ _optionalChain([onSuccess, 'optionalCall', _7 => _7(appState)]);
220
+ }).catch((err) => {
221
+ _optionalChain([onError, 'optionalCall', _8 => _8(err)]);
222
+ });
223
+ }, []);
224
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: loading });
225
+ }
226
+
227
+ // src/components/silent-callback-page.tsx
228
+
229
+ function SilentCallbackPage() {
230
+ _react.useEffect.call(void 0, () => {
231
+ if (window.parent !== window) {
232
+ window.parent.postMessage(
233
+ { type: "acl:silent_callback", url: window.location.href },
234
+ window.location.origin
235
+ );
236
+ }
237
+ }, []);
238
+ return null;
239
+ }
240
+
241
+ // src/index.ts
242
+ var _browser = require('@acl-identity/browser');
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ exports.ACLBrowserClient = _browser.ACLBrowserClient; exports.AuthProvider = AuthProvider; exports.CallbackHandler = CallbackHandler; exports.SignInButton = SignInButton; exports.SignOutButton = SignOutButton; exports.SilentCallbackPage = SilentCallbackPage; exports.useAuth = useAuth;
252
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/lanreyusuf/Developer/personal/acl-identity-sdk/packages/react/dist/index.js","../src/provider.tsx","../src/context.ts","../src/hooks/use-auth.ts","../src/components/sign-in-button.tsx","../src/components/callback-handler.tsx","../src/components/silent-callback-page.tsx","../src/index.ts"],"names":["useEffect"],"mappings":"AAAA;ACAA;AACE;AACA;AACA;AACA;AAAA,8BAEK;AAEP,0CAA+B;ADA/B;AACA;AETA;AA6BO,IAAM,YAAA,EAAc,kCAAA,IAA2C,CAAA;AFjBtE;AACA;AC8LI,+CAAA;AAhKJ,IAAM,gBAAA,EAAkB,WAAA;AAEjB,SAAS,YAAA,CAAa;AAAA,EAC3B,MAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EACA,kBAAA;AAAA,EACA;AACF,CAAA,EAAsB;AACpB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,EAAA,EAAI,6BAAA;AAAoB,IAC5C,IAAA,EAAM,IAAA;AAAA,I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BAAA;AACA,MAAA;AACF,IAAA;AACC,IAAA;AACH,EAAA;AAGE,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AACE,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACF,MAAA;AAEC,MAAA;AAAA,IAAA;AACH,EAAA;AAEJ;AD1DS;AACA;AGnKA;AAGO;AACR,EAAA;AACD,EAAA;AACH,IAAA;AACE,MAAA;AAEF,IAAA;AACF,EAAA;AACO,EAAA;AACT;AHkKS;AACA;AI5JL;AAXY;AACR,EAAA;AAEA,EAAA;AACJ,oBAAA;AACK,IAAA;AACH,MAAA;AACF,IAAA;AACF,EAAA;AAGE,EAAA;AAIJ;AAOgB;AACd,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACG,EAAA;AACkB;AACf,EAAA;AAEA,EAAA;AACJ,oBAAA;AACK,IAAA;AACH,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AAGE,EAAA;AAIJ;AJwJS;AACA;AK/MA;AAmDA;AAlBO;AACR,EAAA;AACA,EAAA;AAENA,EAAAA;AACM,IAAA;AACJ,IAAA;AAEA,IAAA;AAEI,MAAA;AACA,sBAAA;AAED,IAAA;AACC,sBAAA;AACD,IAAA;AACA,EAAA;AAEE,EAAA;AACT;AL6KS;AACA;AMlOA;AAoBO;AACdA,EAAAA;AACM,IAAA;AACF,MAAA;AACE,QAAA;AACA,QAAA;AACF,MAAA;AACF,IAAA;AACG,EAAA;AAEE,EAAA;AACT;ANgNS;AACA;AOhOA;APkOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/lanreyusuf/Developer/personal/acl-identity-sdk/packages/react/dist/index.js","sourcesContent":[null,"import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport type { ACLBrowserClient } from '@acl-identity/browser';\nimport { tokenExpiresAt } from '@acl-identity/core';\nimport type { UserClaims } from '@acl-identity/types';\nimport { AuthContext, type SignInOptions, type SignOutOptions } from './context';\n\nexport interface AuthProviderProps {\n client: ACLBrowserClient;\n /** OAuth2 client_id — passed to buildAuthorizationUrl and silentRenew */\n clientId: string;\n /** Redirect URI registered with the auth server for the main auth flow */\n redirectUri: string;\n /** Organization slug for multi-tenant routing */\n orgSlug?: string;\n /** Space-separated OAuth2 scopes. Defaults to 'openid profile email' */\n scopes?: string;\n /**\n * Redirect URI for silent token renewal via hidden iframe.\n * Must be registered with the auth server. The page at this URI\n * must render <SilentCallbackPage />.\n */\n silentRedirectUri?: string;\n /**\n * Called after the OAuth2 redirect callback is processed.\n * Use this to navigate the user to their intended destination.\n */\n onRedirectCallback?: (appState?: unknown) => void;\n children: ReactNode;\n}\n\ninterface AuthState {\n user: UserClaims | null;\n isAuthenticated: boolean;\n isLoading: boolean;\n error: Error | null;\n}\n\nconst PKCE_KEY_PREFIX = 'acl:pkce:';\n\nexport function AuthProvider({\n client,\n clientId,\n redirectUri,\n orgSlug,\n scopes,\n silentRedirectUri,\n onRedirectCallback,\n children,\n}: AuthProviderProps) {\n const [state, setState] = useState<AuthState>({\n user: null,\n isAuthenticated: false,\n isLoading: true,\n error: null,\n });\n\n const initialized = useRef(false);\n\n const syncAuthState = useCallback(async () => {\n const [user, isAuthenticated] = await Promise.all([\n client.auth.parseCurrentUser(),\n client.auth.isAuthenticated(),\n ]);\n setState({ user, isAuthenticated, isLoading: false, error: null });\n }, [client]);\n\n const handleSilentRenew = useCallback(async () => {\n if (!silentRedirectUri) {\n setState((s) => ({ ...s, isLoading: false }));\n return;\n }\n try {\n await client.auth.silentRenew(silentRedirectUri, clientId, { orgSlug, scope: scopes });\n await syncAuthState();\n } catch {\n setState({ user: null, isAuthenticated: false, isLoading: false, error: null });\n }\n }, [client, silentRedirectUri, clientId, orgSlug, scopes, syncAuthState]);\n\n // Initial session check — runs once on mount\n useEffect(() => {\n if (initialized.current) return;\n initialized.current = true;\n\n const url = new URL(window.location.href);\n const isCallbackUrl = url.searchParams.has('code') && url.searchParams.has('state');\n\n if (isCallbackUrl) {\n // Stay loading while CallbackHandler processes the code exchange\n return;\n }\n\n client.auth.isAuthenticated().then((isAuth) => {\n if (isAuth) {\n syncAuthState();\n } else {\n handleSilentRenew();\n }\n });\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Schedule proactive silent renew before the current token expires\n useEffect(() => {\n if (!state.user || !silentRedirectUri) return;\n\n let timer: ReturnType<typeof setTimeout>;\n\n client.auth.getAccessToken().then((token) => {\n if (!token) return;\n const expiresAtMs = tokenExpiresAt(token);\n if (!expiresAtMs) return;\n\n const msUntilRenew = expiresAtMs - Date.now() - 30_000;\n if (msUntilRenew <= 0) {\n handleSilentRenew();\n return;\n }\n timer = setTimeout(handleSilentRenew, msUntilRenew);\n });\n\n return () => clearTimeout(timer);\n }, [state.user, silentRedirectUri, handleSilentRenew, client]);\n\n const signIn = useCallback(\n async (options?: SignInOptions) => {\n const { url, state: authState, codeVerifier } = await client.auth.buildAuthorizationUrl({\n clientId,\n redirectUri,\n orgSlug,\n scope: scopes,\n });\n sessionStorage.setItem(\n `${PKCE_KEY_PREFIX}${authState}`,\n JSON.stringify({ codeVerifier, appState: options?.appState ?? null })\n );\n window.location.href = url;\n },\n [client, clientId, redirectUri, orgSlug, scopes]\n );\n\n const signOut = useCallback(\n async (options?: SignOutOptions) => {\n await client.auth.logout({ revokeToken: options?.revokeToken });\n setState({ user: null, isAuthenticated: false, isLoading: false, error: null });\n if (options?.returnTo) {\n window.location.href = options.returnTo;\n }\n },\n [client]\n );\n\n const getAccessToken = useCallback(() => client.auth.getAccessToken(), [client]);\n\n const handleCallback = useCallback(\n async (callbackUrl?: string): Promise<{ appState?: unknown }> => {\n const url = new URL(callbackUrl ?? window.location.href);\n const error = url.searchParams.get('error');\n\n if (error) {\n const desc = url.searchParams.get('error_description') ?? error;\n const err = new Error(desc);\n setState((s) => ({ ...s, error: err, isLoading: false }));\n throw err;\n }\n\n const code = url.searchParams.get('code');\n const authState = url.searchParams.get('state');\n\n if (!code || !authState) {\n const err = new Error('Missing code or state in callback URL');\n setState((s) => ({ ...s, error: err, isLoading: false }));\n throw err;\n }\n\n const stored = sessionStorage.getItem(`${PKCE_KEY_PREFIX}${authState}`);\n if (!stored) {\n const err = new Error('Auth session expired or state mismatch. Please sign in again.');\n setState((s) => ({ ...s, error: err, isLoading: false }));\n throw err;\n }\n\n const { codeVerifier, appState } = JSON.parse(stored) as {\n codeVerifier: string;\n appState?: unknown;\n };\n sessionStorage.removeItem(`${PKCE_KEY_PREFIX}${authState}`);\n\n await client.auth.exchangeCode(code, codeVerifier, redirectUri);\n await syncAuthState();\n\n onRedirectCallback?.(appState);\n return { appState };\n },\n [client, redirectUri, syncAuthState, onRedirectCallback]\n );\n\n return (\n <AuthContext.Provider\n value={{\n ...state,\n client,\n clientId,\n redirectUri,\n orgSlug,\n scopes,\n signIn,\n signOut,\n getAccessToken,\n handleCallback,\n }}\n >\n {children}\n </AuthContext.Provider>\n );\n}\n","import { createContext } from 'react';\nimport type { ACLBrowserClient } from '@acl-identity/browser';\nimport type { UserClaims } from '@acl-identity/types';\n\nexport interface SignInOptions {\n appState?: unknown;\n}\n\nexport interface SignOutOptions {\n returnTo?: string;\n revokeToken?: boolean;\n}\n\nexport interface AuthContextValue {\n user: UserClaims | null;\n isAuthenticated: boolean;\n isLoading: boolean;\n error: Error | null;\n client: ACLBrowserClient;\n clientId: string;\n redirectUri: string;\n orgSlug?: string;\n scopes?: string;\n signIn(options?: SignInOptions): Promise<void>;\n signOut(options?: SignOutOptions): Promise<void>;\n getAccessToken(): Promise<string | null>;\n handleCallback(callbackUrl?: string): Promise<{ appState?: unknown }>;\n}\n\nexport const AuthContext = createContext<AuthContextValue | null>(null);\n","import { useContext } from 'react';\nimport { AuthContext, type AuthContextValue } from '../context';\n\nexport function useAuth(): AuthContextValue {\n const ctx = useContext(AuthContext);\n if (!ctx) {\n throw new Error(\n 'useAuth must be used within an <AuthProvider>. ' +\n 'Wrap your app (or the relevant subtree) with <AuthProvider client={...} clientId={...} redirectUri={...} />.'\n );\n }\n return ctx;\n}\n","import { type ButtonHTMLAttributes } from 'react';\nimport { useAuth } from '../hooks/use-auth';\nimport type { SignOutOptions } from '../context';\n\nexport interface SignInButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n appState?: unknown;\n}\n\nexport function SignInButton({ children = 'Sign in', appState, onClick, ...props }: SignInButtonProps) {\n const { signIn } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n if (!e.defaultPrevented) {\n signIn({ appState });\n }\n };\n\n return (\n <button type=\"button\" onClick={handleClick} {...props}>\n {children}\n </button>\n );\n}\n\nexport interface SignOutButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n returnTo?: string;\n revokeToken?: boolean;\n}\n\nexport function SignOutButton({\n children = 'Sign out',\n returnTo,\n revokeToken,\n onClick,\n ...props\n}: SignOutButtonProps) {\n const { signOut } = useAuth();\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n if (!e.defaultPrevented) {\n const options: SignOutOptions = {};\n if (returnTo) options.returnTo = returnTo;\n if (revokeToken !== undefined) options.revokeToken = revokeToken;\n signOut(options);\n }\n };\n\n return (\n <button type=\"button\" onClick={handleClick} {...props}>\n {children}\n </button>\n );\n}\n","import { useEffect, useRef } from 'react';\nimport { useAuth } from '../hooks/use-auth';\n\nexport interface CallbackHandlerProps {\n /** Called after tokens are stored and auth state is updated. Use this to navigate away. */\n onSuccess?: (appState?: unknown) => void;\n /** Called if the code exchange fails. */\n onError?: (error: Error) => void;\n /** Rendered while the code exchange is in progress. */\n loading?: React.ReactNode;\n}\n\n/**\n * Place this component on the route that matches your `redirectUri`.\n * It reads the `?code=` and `?state=` from the URL, exchanges them for\n * tokens, then calls `onSuccess`. The URL is cleaned up automatically.\n *\n * @example\n * // app/callback/page.tsx\n * 'use client';\n * import { CallbackHandler } from '@acl-identity/react';\n * import { useRouter } from 'next/navigation';\n *\n * export default function CallbackPage() {\n * const router = useRouter();\n * return (\n * <CallbackHandler\n * onSuccess={(appState) => router.replace(appState?.returnTo ?? '/dashboard')}\n * onError={() => router.replace('/login?error=callback_failed')}\n * />\n * );\n * }\n */\nexport function CallbackHandler({ onSuccess, onError, loading = null }: CallbackHandlerProps) {\n const { handleCallback } = useAuth();\n const called = useRef(false);\n\n useEffect(() => {\n if (called.current) return;\n called.current = true;\n\n handleCallback()\n .then(({ appState }) => {\n window.history.replaceState({}, document.title, window.location.pathname);\n onSuccess?.(appState);\n })\n .catch((err: Error) => {\n onError?.(err);\n });\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return <>{loading}</>;\n}\n","import { useEffect } from 'react';\n\n/**\n * Render this component (and nothing else) at the route matching your\n * `silentRedirectUri`. It posts the current URL back to the parent window\n * so the hidden iframe used by silent renew can complete the token exchange.\n *\n * The route must be registered as an allowed redirect URI on your OAuth client.\n *\n * @example\n * // app/silent-callback/page.tsx (Next.js App Router)\n * 'use client';\n * import { SilentCallbackPage } from '@acl-identity/react';\n * export default SilentCallbackPage;\n *\n * @example\n * // pages/silent-callback.tsx (Next.js Pages Router)\n * import { SilentCallbackPage } from '@acl-identity/react';\n * export default SilentCallbackPage;\n */\nexport function SilentCallbackPage() {\n useEffect(() => {\n if (window.parent !== window) {\n window.parent.postMessage(\n { type: 'acl:silent_callback', url: window.location.href },\n window.location.origin\n );\n }\n }, []);\n\n return null;\n}\n","export { AuthProvider } from './provider';\nexport type { AuthProviderProps } from './provider';\n\nexport { useAuth } from './hooks/use-auth';\n\nexport { SignInButton, SignOutButton } from './components/sign-in-button';\nexport type { SignInButtonProps, SignOutButtonProps } from './components/sign-in-button';\n\nexport { CallbackHandler } from './components/callback-handler';\nexport type { CallbackHandlerProps } from './components/callback-handler';\n\nexport { SilentCallbackPage } from './components/silent-callback-page';\n\nexport type { AuthContextValue, SignInOptions, SignOutOptions } from './context';\n\n// Re-export the browser client so consumers need only one install\nexport { ACLBrowserClient } from '@acl-identity/browser';\nexport type { ACLBrowserClientConfig } from '@acl-identity/browser';\n// Re-export useful types\nexport type { UserClaims, OrgContext } from '@acl-identity/types';\n"]}