@civic/auth 0.11.9-beta.2 → 0.12.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/CHANGELOG.md +3 -1
- package/dist/nextjs/providers/NextAuthProvider.d.ts +1 -4
- package/dist/nextjs/providers/NextAuthProvider.d.ts.map +1 -1
- package/dist/nextjs/providers/NextAuthProvider.js.map +1 -1
- package/dist/nextjs/providers/NextAuthProviderClient.d.ts +6 -2
- package/dist/nextjs/providers/NextAuthProviderClient.d.ts.map +1 -1
- package/dist/nextjs/providers/NextAuthProviderClient.js.map +1 -1
- package/dist/shared/providers/types.d.ts +16 -0
- package/dist/shared/providers/types.d.ts.map +1 -1
- package/dist/shared/providers/types.js.map +1 -1
- package/dist/shared/version.d.ts +1 -1
- package/dist/shared/version.d.ts.map +1 -1
- package/dist/shared/version.js +1 -1
- package/dist/shared/version.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# 0.12.0 - Remove unused redirect parameters from NextJS provider interface
|
|
2
|
+
- Remove unused redirectOnLogin and redirectOnLogout parameters
|
|
3
|
+
|
|
1
4
|
# 0.11.9 - Fix NextJS logout race condition
|
|
2
5
|
- fix a race condition in NextJS logout to clear cookies immediately using a new 'clearsession' route handler
|
|
3
6
|
|
|
4
|
-
|
|
5
7
|
# 0.11.8 - Comprehensive loading states and UX improvements
|
|
6
8
|
- Added loading states to all auth buttons (SignInButton, SignOutButton, UserButton) with consistent visual feedback
|
|
7
9
|
- Fixed logout flickering by showing "Logging out..." state and preventing premature transition to "Log in"
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { AuthProviderProps } from "../../shared/providers/types.js";
|
|
2
2
|
type NextCivicAuthProviderProps = Omit<AuthProviderProps, "clientId" | "onSignIn" | "onSignOut">;
|
|
3
|
-
export declare function CivicNextAuthProvider({ children, ...props }: NextCivicAuthProviderProps
|
|
4
|
-
redirectOnLogin?: string;
|
|
5
|
-
redirectOnLogout?: string;
|
|
6
|
-
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export declare function CivicNextAuthProvider({ children, ...props }: NextCivicAuthProviderProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
7
4
|
export type { NextCivicAuthProviderProps };
|
|
8
5
|
//# sourceMappingURL=NextAuthProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextAuthProvider.d.ts","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,KAAK,0BAA0B,GAAG,IAAI,CACpC,iBAAiB,EACjB,UAAU,GAAG,UAAU,GAAG,WAAW,CACtC,CAAC;AAGF,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"NextAuthProvider.d.ts","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,KAAK,0BAA0B,GAAG,IAAI,CACpC,iBAAiB,EACjB,UAAU,GAAG,UAAU,GAAG,WAAW,CACtC,CAAC;AAGF,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,0BAA0B,oDA2B5B;AAGD,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextAuthProvider.js","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO1C,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,QAAQ,EACR,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"NextAuthProvider.js","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO1C,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,QAAQ,EACR,GAAG,KAAK,EACmB;IAC3B,sEAAsE;IACtE,IAAI,UAAU,GAAgB,IAAI,CAAC;IACnC,IAAI,YAAY,GAAuB,IAAI,CAAC;IAE5C,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,OAAO,EAAE,CAAC;QAC7B,YAAY,GAAG,MAAM,SAAS,EAAE,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,8CAA8C;QAC9C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAC5B,yCAAyC,EACzC,KAAK,CACN,CAAC;QACF,UAAU,GAAG,IAAI,CAAC;QAClB,YAAY,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,OAAO,CACL,KAAC,2BAA2B,IAC1B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,KACtB,KAAK,YAER,QAAQ,GACmB,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["/** @jsxImportSource react */\nimport React from \"react\";\nimport { getUser, getTokens } from \"@/nextjs/index.js\";\nimport type { User, OAuthTokens } from \"@/types.js\";\nimport type { AuthProviderProps } from \"@/shared/providers/types.js\";\nimport { CivicNextAuthProviderClient } from \"./NextAuthProviderClient.js\";\nimport { loggers } from \"@/lib/logger.js\";\n\ntype NextCivicAuthProviderProps = Omit<\n AuthProviderProps,\n \"clientId\" | \"onSignIn\" | \"onSignOut\"\n>;\n\n// Server component that reads user data and passes it to client component\nexport async function CivicNextAuthProvider({\n children,\n ...props\n}: NextCivicAuthProviderProps) {\n // Read user data and tokens server-side to prevent hydration mismatch\n let serverUser: User | null = null;\n let serverTokens: OAuthTokens | null = null;\n\n try {\n serverUser = await getUser();\n serverTokens = await getTokens();\n } catch (error) {\n // If server-side reading fails, just use null\n loggers.nextjs.providers.debug(\n \"Failed to read user/tokens server-side:\",\n error,\n );\n serverUser = null;\n serverTokens = null;\n }\n\n return (\n <CivicNextAuthProviderClient\n serverUser={serverUser}\n serverTokens={serverTokens}\n {...props}\n >\n {children}\n </CivicNextAuthProviderClient>\n );\n}\n\n// Export the type for external use\nexport type { NextCivicAuthProviderProps };\n"]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { AuthProviderProps } from "../../shared/providers/types.js";
|
|
2
2
|
import type { User, OAuthTokens } from "../../types.js";
|
|
3
3
|
type NextCivicAuthProviderProps = Omit<AuthProviderProps, "clientId">;
|
|
4
|
+
/**
|
|
5
|
+
* Props for the CivicNextAuthProviderClient component.
|
|
6
|
+
* @internal This interface is for internal use - the public API is through CivicAuthProvider.
|
|
7
|
+
*/
|
|
4
8
|
export interface CivicNextAuthProviderClientProps extends NextCivicAuthProviderProps {
|
|
9
|
+
/** Server-provided user data for hydration to prevent hydration mismatch */
|
|
5
10
|
serverUser: User | null;
|
|
11
|
+
/** Server-provided OAuth tokens for hydration */
|
|
6
12
|
serverTokens: OAuthTokens | null;
|
|
7
|
-
redirectOnLogin?: string;
|
|
8
|
-
redirectOnLogout?: string;
|
|
9
13
|
}
|
|
10
14
|
export declare const CivicNextAuthProviderClient: ({ children, serverUser, serverTokens, ...props }: CivicNextAuthProviderClientProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextAuthProviderClient.d.ts","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProviderClient.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIpD,KAAK,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAEtE,MAAM,WAAW,gCACf,SAAQ,0BAA0B;IAClC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"NextAuthProviderClient.d.ts","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProviderClient.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIpD,KAAK,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,gCACf,SAAQ,0BAA0B;IAClC,4EAA4E;IAC5E,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,iDAAiD;IACjD,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC;AAID,eAAO,MAAM,2BAA2B,qDAKrC,gCAAgC,4CA8ElC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextAuthProviderClient.js","sourceRoot":"","sources":["../../../src/nextjs/providers/NextAuthProviderClient.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AA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AAG,EAAE;QACb,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;YAC5B,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,WAAW,EAAE,CAAC;gBAEhD,IAAI,gBAAgB,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CACxB,4CAA4C,gBAAgB,CAAC,OAAO,OAAO,QAAQ,yBAAyB,CAC7G,CAAC;oBACF,gBAAgB,CAAC,OAAO,GAAG,QAAQ,CAAC;oBACpC,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC1B,CAAC;gBAED,MAAM,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAC1C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CACX,uDAAuD,EACvD,KAAK,CACN,CAAC;YACJ,CAAC;QACH,CAAC,CAAC;QAEF,iDAAiD;QACjD,yDAAyD;QACzD,gDAAgD;QAChD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAEpD,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IACzB,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAEjD,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,GACxB,CAC9B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/** @jsxImportSource react */\n\"use client\";\n\n/**\n * Client component for NextAuth provider that receives server-provided user data\n */\nimport { resolveAuthConfig } from \"@/nextjs/config.js\";\nimport { GlobalAuthManager } from \"@/reactjs/core/GlobalAuthManager.js\";\nimport { AuthStatusProvider } from \"@/shared/providers/AuthStatusContext.js\";\nimport { ServerUserContext } from \"./ServerUserContext.js\";\nimport { useInitialAuthConfig } from \"@/nextjs/hooks/useInitialAuthConfig.js\";\nimport type { AuthProviderProps } from \"@/shared/providers/types.js\";\nimport { useEffect, useRef } from \"react\";\nimport type { User, OAuthTokens } from \"@/types.js\";\nimport { usePathname, useRouter } from \"next/navigation.js\";\nimport { loggers } from \"@/lib/logger.js\";\n\ntype NextCivicAuthProviderProps = Omit<AuthProviderProps, \"clientId\">;\n\n/**\n * Props for the CivicNextAuthProviderClient component.\n * @internal This interface is for internal use - the public API is through CivicAuthProvider.\n */\nexport interface CivicNextAuthProviderClientProps\n extends NextCivicAuthProviderProps {\n /** Server-provided user data for hydration to prevent hydration mismatch */\n serverUser: User | null;\n /** Server-provided OAuth tokens for hydration */\n serverTokens: OAuthTokens | null;\n}\n\n// Context to provide server user data immediately to useUser hook\n\nexport const CivicNextAuthProviderClient = ({\n children,\n serverUser,\n serverTokens,\n ...props\n}: CivicNextAuthProviderClientProps) => {\n const router = useRouter();\n const resolvedConfig = resolveAuthConfig();\n const { oauthServer, loginSuccessUrl, disableRefresh } = resolvedConfig;\n\n const pathname = usePathname();\n const previousPathname = useRef(pathname);\n\n // Initialize GlobalAuthManager synchronously with server user data\n // This ensures the server user is available immediately when useUser() is called\n const { initialConfig, hasSignedOut } = useInitialAuthConfig({\n disableRefresh,\n logging: props.logging,\n displayMode: props.displayMode || \"iframe\",\n iframeMode: props.iframeMode,\n serverUser: serverUser,\n nonce: props.nonce,\n targetContainerElement: props.targetContainerElement,\n oauthServer: oauthServer,\n loginSuccessUrl: loginSuccessUrl,\n onUrlChange: (url: string, source?: string) => {\n // Handle different URL change sources\n switch (source) {\n case \"login\":\n console.log(`[NextAuthProvider] Authentication redirect: ${url}`);\n window.location.href = url;\n break;\n case \"login_app\":\n console.log(`[NextAuthProvider] Login app redirect: ${url}`);\n window.location.href = url;\n break;\n default:\n console.log(\n `[NextAuthProvider] Navigating to: ${url} (source: ${source || \"unknown\"})`,\n );\n router.push(url);\n }\n },\n });\n\n // Initialize auth manager with server-provided data\n useEffect(() => {\n const initialize = async () => {\n try {\n const manager = GlobalAuthManager.getInstance();\n\n if (previousPathname.current !== pathname) {\n loggers.nextjs.hooks.debug(\n `[NextAuthProvider] Pathname changed from ${previousPathname.current} to ${pathname}, cleaning auth manager`,\n );\n previousPathname.current = pathname;\n await manager.cleanup();\n }\n\n await manager.initialize(initialConfig);\n } catch (error) {\n console.error(\n \"[NextAuthProvider] Failed to initialize auth manager:\",\n error,\n );\n }\n };\n\n // don't immediately initialize while signing out\n // or we might overwrite the signed-out state the version\n // from the /user endpoint before it has updated\n if (!hasSignedOut) {\n initialize();\n }\n }, [initialConfig, router, pathname, hasSignedOut]);\n\n return (\n <ServerUserContext.Provider\n value={{ user: serverUser, tokens: serverTokens }}\n >\n <AuthStatusProvider>{children}</AuthStatusProvider>\n </ServerUserContext.Provider>\n );\n};\n"]}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
import type { Config, DisplayMode, IframeMode } from "../../types.js";
|
|
2
2
|
import type { LoggingConfig, OnSignInResponse, OnSignOutResponse } from "../../vanillajs/index.js";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Civic Auth provider component.
|
|
6
|
+
* These props configure the authentication behavior and UI display.
|
|
7
|
+
*/
|
|
4
8
|
export type AuthProviderProps = {
|
|
9
|
+
/** React children to render within the auth provider */
|
|
5
10
|
children: ReactNode;
|
|
11
|
+
/** Civic Auth client ID from your Civic dashboard */
|
|
6
12
|
clientId: string;
|
|
13
|
+
/** Optional nonce for additional security in the OAuth flow */
|
|
7
14
|
nonce?: string;
|
|
15
|
+
/** Callback fired after successful or failed sign-in */
|
|
8
16
|
onSignIn?: (response: OnSignInResponse) => void | Promise<void>;
|
|
17
|
+
/** Callback fired after sign-out */
|
|
9
18
|
onSignOut?: (response: OnSignOutResponse) => void | Promise<void>;
|
|
19
|
+
/** Iframe display mode when displayMode is "iframe" - "modal" shows centered overlay, "embedded" renders in targetContainerElement */
|
|
10
20
|
iframeMode?: IframeMode;
|
|
21
|
+
/** Additional configuration options for the auth client */
|
|
11
22
|
config?: Config;
|
|
23
|
+
/** URL to redirect to after successful authentication */
|
|
12
24
|
redirectUrl?: string;
|
|
25
|
+
/** URL to redirect to after logout */
|
|
13
26
|
logoutRedirectUrl?: string;
|
|
27
|
+
/** Display mode for the authentication UI - "iframe" (default), "redirect", or "new_tab" */
|
|
14
28
|
displayMode?: DisplayMode;
|
|
29
|
+
/** DOM element or CSS selector where embedded iframe should render (only used when iframeMode is "embedded") */
|
|
15
30
|
targetContainerElement?: HTMLElement | string;
|
|
31
|
+
/** Logging configuration for debugging */
|
|
16
32
|
logging?: LoggingConfig;
|
|
17
33
|
};
|
|
18
34
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAA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AC9C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/providers/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config, DisplayMode, IframeMode } from \"@/types.js\";\nimport type {\n LoggingConfig,\n OnSignInResponse,\n OnSignOutResponse,\n} from \"@/vanillajs/index.js\";\nimport type { ReactNode } from \"react\";\n\nexport type AuthProviderProps = {\n children: ReactNode;\n clientId: string;\n nonce?: string;\n onSignIn?: (response: OnSignInResponse) => void | Promise<void>;\n onSignOut?: (response: OnSignOutResponse) => void | Promise<void>;\n iframeMode?: IframeMode;\n config?: Config;\n redirectUrl?: string;\n logoutRedirectUrl?: string;\n displayMode?: DisplayMode;\n targetContainerElement?: HTMLElement | string;\n logging?: LoggingConfig;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/providers/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config, DisplayMode, IframeMode } from \"@/types.js\";\nimport type {\n LoggingConfig,\n OnSignInResponse,\n OnSignOutResponse,\n} from \"@/vanillajs/index.js\";\nimport type { ReactNode } from \"react\";\n\n/**\n * Props for the Civic Auth provider component.\n * These props configure the authentication behavior and UI display.\n */\nexport type AuthProviderProps = {\n /** React children to render within the auth provider */\n children: ReactNode;\n /** Civic Auth client ID from your Civic dashboard */\n clientId: string;\n /** Optional nonce for additional security in the OAuth flow */\n nonce?: string;\n /** Callback fired after successful or failed sign-in */\n onSignIn?: (response: OnSignInResponse) => void | Promise<void>;\n /** Callback fired after sign-out */\n onSignOut?: (response: OnSignOutResponse) => void | Promise<void>;\n /** Iframe display mode when displayMode is \"iframe\" - \"modal\" shows centered overlay, \"embedded\" renders in targetContainerElement */\n iframeMode?: IframeMode;\n /** Additional configuration options for the auth client */\n config?: Config;\n /** URL to redirect to after successful authentication */\n redirectUrl?: string;\n /** URL to redirect to after logout */\n logoutRedirectUrl?: string;\n /** Display mode for the authentication UI - \"iframe\" (default), \"redirect\", or \"new_tab\" */\n displayMode?: DisplayMode;\n /** DOM element or CSS selector where embedded iframe should render (only used when iframeMode is \"embedded\") */\n targetContainerElement?: HTMLElement | string;\n /** Logging configuration for debugging */\n logging?: LoggingConfig;\n};\n"]}
|
package/dist/shared/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "@civic/auth:0.
|
|
1
|
+
export declare const VERSION = "@civic/auth:0.12.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,uBAAuB,CAAC"}
|
package/dist/shared/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB,CAAC","sourcesContent":["// This is an auto-generated file. Do not edit.\n\nexport const VERSION = \"@civic/auth:0.12.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civic/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"vite": "^5",
|
|
90
90
|
"vite-plugin-dts": "^4.2.3",
|
|
91
91
|
"vitest": "^2.1.8",
|
|
92
|
-
"@repo/
|
|
93
|
-
"@repo/
|
|
92
|
+
"@repo/eslint-config": "0.0.0",
|
|
93
|
+
"@repo/typescript-config": "0.0.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"express": ">=4.0.0",
|