@tern-secure/nextjs 3.2.3 → 3.2.4

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.
@@ -27,7 +27,6 @@ var import_react = require("react");
27
27
  var import_client_init = require("../utils/client-init");
28
28
  var import_auth = require("firebase/auth");
29
29
  var import_TernSecureCtx = require("./TernSecureCtx");
30
- const INTERNAL_CONTEXT_KEY = Symbol("TERN_SECURE_CONTEXT");
31
30
  function TernSecureClientProvider({
32
31
  children,
33
32
  Loading = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Loading..." })
@@ -60,8 +59,7 @@ function TernSecureClientProvider({
60
59
  return () => unsubscribe();
61
60
  }, []);
62
61
  const contextValue = (0, import_react.useMemo)(() => ({
63
- ...authState,
64
- _contextKey: INTERNAL_CONTEXT_KEY
62
+ ...authState
65
63
  }), [authState]);
66
64
  if (!authState.isLoaded) {
67
65
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {});
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React, { useState, useEffect, useMemo } from 'react'\r\nimport { TernSecureAuth } from '../utils/client-init'\r\nimport { onAuthStateChanged } from \"firebase/auth\"\r\nimport { TernSecureCtx, TernSecureState, TernSecureCtxValue } from './TernSecureCtx'\r\n\r\ninterface TernSecureClientProviderProps {\r\n children: React.ReactNode\r\n Loading?: React.ComponentType\r\n}\r\n\r\nconst INTERNAL_CONTEXT_KEY = Symbol('TERN_SECURE_CONTEXT')\r\n\r\nexport function TernSecureClientProvider({ \r\n children,\r\n Loading = () => <div>Loading...</div>\r\n}: TernSecureClientProviderProps) {\r\n const [authState, setAuthState] = useState<TernSecureState>({\r\n userId: null,\r\n isLoaded: false,\r\n error: null,\r\n isSignedIn: false\r\n })\r\n\r\n useEffect(() => {\r\n const auth = TernSecureAuth();\r\n const unsubscribe = onAuthStateChanged(auth, (user) => {\r\n if (user) {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: true,\r\n userId: user.uid,\r\n error: null\r\n })\r\n } else {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: false,\r\n userId: null,\r\n error: null\r\n })\r\n }\r\n })\r\n \r\n return () => unsubscribe()\r\n }, [])\r\n\r\n const contextValue: TernSecureCtxValue = useMemo(() => ({\r\n ...authState,\r\n _contextKey: INTERNAL_CONTEXT_KEY\r\n }), [authState])\r\n\r\n if (!authState.isLoaded) {\r\n return <Loading />\r\n }\r\n\r\n return (\r\n <TernSecureCtx.Provider value={contextValue}>\r\n {children}\r\n </TernSecureCtx.Provider>\r\n )\r\n}\r\n\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBkB;AAdlB,mBAAoD;AACpD,yBAA+B;AAC/B,kBAAmC;AACnC,2BAAmE;AAOnE,MAAM,uBAAuB,OAAO,qBAAqB;AAElD,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA,UAAU,MAAM,4CAAC,SAAI,wBAAU;AACjC,GAAmC;AACjC,QAAM,CAAC,WAAW,YAAY,QAAI,uBAA0B;AAAA,IAC1D,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,EACd,CAAC;AAED,8BAAU,MAAM;AACd,UAAM,WAAO,mCAAe;AAC5B,UAAM,kBAAc,gCAAmB,MAAM,CAAC,SAAS;AACrD,UAAI,MAAM;AACR,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ,KAAK;AAAA,UACb,OAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AACL,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO,MAAM,YAAY;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmC,sBAAQ,OAAO;AAAA,IACtD,GAAG;AAAA,IACH,aAAa;AAAA,EACf,IAAI,CAAC,SAAS,CAAC;AAEf,MAAI,CAAC,UAAU,UAAU;AACvB,WAAO,4CAAC,WAAQ;AAAA,EAClB;AAEA,SACE,4CAAC,mCAAc,UAAd,EAAuB,OAAO,cAC5B,UACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React, { useState, useEffect, useMemo } from 'react'\r\nimport { TernSecureAuth } from '../utils/client-init'\r\nimport { onAuthStateChanged } from \"firebase/auth\"\r\nimport { TernSecureCtx, TernSecureState, TernSecureCtxValue } from './TernSecureCtx'\r\n\r\ninterface TernSecureClientProviderProps {\r\n children: React.ReactNode\r\n Loading?: React.ComponentType\r\n}\r\n\r\nexport function TernSecureClientProvider({ \r\n children,\r\n Loading = () => <div>Loading...</div>\r\n}: TernSecureClientProviderProps) {\r\n const [authState, setAuthState] = useState<TernSecureState>({\r\n userId: null,\r\n isLoaded: false,\r\n error: null,\r\n isSignedIn: false\r\n })\r\n\r\n useEffect(() => {\r\n const auth = TernSecureAuth();\r\n const unsubscribe = onAuthStateChanged(auth, (user) => {\r\n if (user) {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: true,\r\n userId: user.uid,\r\n error: null\r\n })\r\n } else {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: false,\r\n userId: null,\r\n error: null\r\n })\r\n }\r\n })\r\n \r\n return () => unsubscribe()\r\n }, [])\r\n\r\n const contextValue: TernSecureCtxValue = useMemo(() => ({\r\n ...authState,\r\n }), [authState])\r\n\r\n if (!authState.isLoaded) {\r\n return <Loading />\r\n }\r\n\r\n return (\r\n <TernSecureCtx.Provider value={contextValue}>\r\n {children}\r\n </TernSecureCtx.Provider>\r\n )\r\n}\r\n\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAckB;AAZlB,mBAAoD;AACpD,yBAA+B;AAC/B,kBAAmC;AACnC,2BAAmE;AAO5D,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA,UAAU,MAAM,4CAAC,SAAI,wBAAU;AACjC,GAAmC;AACjC,QAAM,CAAC,WAAW,YAAY,QAAI,uBAA0B;AAAA,IAC1D,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,EACd,CAAC;AAED,8BAAU,MAAM;AACd,UAAM,WAAO,mCAAe;AAC5B,UAAM,kBAAc,gCAAmB,MAAM,CAAC,SAAS;AACrD,UAAI,MAAM;AACR,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ,KAAK;AAAA,UACb,OAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AACL,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO,MAAM,YAAY;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,mBAAmC,sBAAQ,OAAO;AAAA,IACtD,GAAG;AAAA,EACL,IAAI,CAAC,SAAS,CAAC;AAEf,MAAI,CAAC,UAAU,UAAU;AACvB,WAAO,4CAAC,WAAQ;AAAA,EAClB;AAEA,SACE,4CAAC,mCAAc,UAAd,EAAuB,OAAO,cAC5B,UACH;AAEJ;","names":[]}
@@ -24,12 +24,11 @@ __export(TernSecureCtx_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(TernSecureCtx_exports);
26
26
  var import_react = require("react");
27
- const INTERNAL_CONTEXT_KEY = Symbol("TERN_SECURE_CONTEXT");
28
27
  const TernSecureCtx = (0, import_react.createContext)(null);
29
28
  TernSecureCtx.displayName = "TernSecureCtx";
30
29
  const useTernSecure = (hookName) => {
31
30
  const context = (0, import_react.useContext)(TernSecureCtx);
32
- if (!context || context._contextKey !== INTERNAL_CONTEXT_KEY) {
31
+ if (!context) {
33
32
  throw new Error(
34
33
  `${hookName} must be used within TernSecureProvider`
35
34
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/boundary/TernSecureCtx.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { createContext, useContext } from 'react'\r\n\r\n// Core types\r\nexport interface TernSecureState {\r\n userId: string | null\r\n isLoaded: boolean\r\n error: string | null\r\n isSignedIn: boolean\r\n}\r\n\r\nexport type TernSecureCtxValue = TernSecureState & {\r\n _contextKey: symbol\r\n}\r\n\r\n// Context with proper null handling\r\nconst INTERNAL_CONTEXT_KEY = Symbol('TERN_SECURE_CONTEXT')\r\nexport const TernSecureCtx = createContext<TernSecureCtxValue | null>(null)\r\n\r\n// Set display name for better debugging\r\nTernSecureCtx.displayName = 'TernSecureCtx'\r\n\r\nexport const useTernSecure = (hookName: string) => {\r\n const context = useContext(TernSecureCtx)\r\n \r\n if (!context || context._contextKey !== INTERNAL_CONTEXT_KEY) {\r\n throw new Error(\r\n `${hookName} must be used within TernSecureProvider`\r\n )\r\n }\r\n\r\n return context\r\n}\r\n\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0C;AAe1C,MAAM,uBAAuB,OAAO,qBAAqB;AAClD,MAAM,oBAAgB,4BAAyC,IAAI;AAG1E,cAAc,cAAc;AAErB,MAAM,gBAAgB,CAAC,aAAqB;AACjD,QAAM,cAAU,yBAAW,aAAa;AAExC,MAAI,CAAC,WAAW,QAAQ,gBAAgB,sBAAsB;AAC5D,UAAM,IAAI;AAAA,MACR,GAAG,QAAQ;AAAA,IACb;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/boundary/TernSecureCtx.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { createContext, useContext } from 'react'\r\n\r\n// Core types\r\nexport interface TernSecureState {\r\n userId: string | null\r\n isLoaded: boolean\r\n error: string | null\r\n isSignedIn: boolean\r\n}\r\n\r\nexport type TernSecureCtxValue = TernSecureState\r\n\r\n\r\nexport const TernSecureCtx = createContext<TernSecureCtxValue | null>(null)\r\n\r\n// Set display name for better debugging\r\nTernSecureCtx.displayName = 'TernSecureCtx'\r\n\r\nexport const useTernSecure = (hookName: string) => {\r\n const context = useContext(TernSecureCtx)\r\n \r\n if (!context) {\r\n throw new Error(\r\n `${hookName} must be used within TernSecureProvider`\r\n )\r\n }\r\n\r\n return context\r\n}\r\n\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA0C;AAanC,MAAM,oBAAgB,4BAAyC,IAAI;AAG1E,cAAc,cAAc;AAErB,MAAM,gBAAgB,CAAC,aAAqB;AACjD,QAAM,cAAU,yBAAW,aAAa;AAExC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,GAAG,QAAQ;AAAA,IACb;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -4,7 +4,6 @@ import { useState, useEffect, useMemo } from "react";
4
4
  import { TernSecureAuth } from "../utils/client-init";
5
5
  import { onAuthStateChanged } from "firebase/auth";
6
6
  import { TernSecureCtx } from "./TernSecureCtx";
7
- const INTERNAL_CONTEXT_KEY = Symbol("TERN_SECURE_CONTEXT");
8
7
  function TernSecureClientProvider({
9
8
  children,
10
9
  Loading = () => /* @__PURE__ */ jsx("div", { children: "Loading..." })
@@ -37,8 +36,7 @@ function TernSecureClientProvider({
37
36
  return () => unsubscribe();
38
37
  }, []);
39
38
  const contextValue = useMemo(() => ({
40
- ...authState,
41
- _contextKey: INTERNAL_CONTEXT_KEY
39
+ ...authState
42
40
  }), [authState]);
43
41
  if (!authState.isLoaded) {
44
42
  return /* @__PURE__ */ jsx(Loading, {});
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React, { useState, useEffect, useMemo } from 'react'\r\nimport { TernSecureAuth } from '../utils/client-init'\r\nimport { onAuthStateChanged } from \"firebase/auth\"\r\nimport { TernSecureCtx, TernSecureState, TernSecureCtxValue } from './TernSecureCtx'\r\n\r\ninterface TernSecureClientProviderProps {\r\n children: React.ReactNode\r\n Loading?: React.ComponentType\r\n}\r\n\r\nconst INTERNAL_CONTEXT_KEY = Symbol('TERN_SECURE_CONTEXT')\r\n\r\nexport function TernSecureClientProvider({ \r\n children,\r\n Loading = () => <div>Loading...</div>\r\n}: TernSecureClientProviderProps) {\r\n const [authState, setAuthState] = useState<TernSecureState>({\r\n userId: null,\r\n isLoaded: false,\r\n error: null,\r\n isSignedIn: false\r\n })\r\n\r\n useEffect(() => {\r\n const auth = TernSecureAuth();\r\n const unsubscribe = onAuthStateChanged(auth, (user) => {\r\n if (user) {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: true,\r\n userId: user.uid,\r\n error: null\r\n })\r\n } else {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: false,\r\n userId: null,\r\n error: null\r\n })\r\n }\r\n })\r\n \r\n return () => unsubscribe()\r\n }, [])\r\n\r\n const contextValue: TernSecureCtxValue = useMemo(() => ({\r\n ...authState,\r\n _contextKey: INTERNAL_CONTEXT_KEY\r\n }), [authState])\r\n\r\n if (!authState.isLoaded) {\r\n return <Loading />\r\n }\r\n\r\n return (\r\n <TernSecureCtx.Provider value={contextValue}>\r\n {children}\r\n </TernSecureCtx.Provider>\r\n )\r\n}\r\n\r\n"],"mappings":";AAgBkB;AAdlB,SAAgB,UAAU,WAAW,eAAe;AACpD,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,qBAA0D;AAOnE,MAAM,uBAAuB,OAAO,qBAAqB;AAElD,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA,UAAU,MAAM,oBAAC,SAAI,wBAAU;AACjC,GAAmC;AACjC,QAAM,CAAC,WAAW,YAAY,IAAI,SAA0B;AAAA,IAC1D,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,EACd,CAAC;AAED,YAAU,MAAM;AACd,UAAM,OAAO,eAAe;AAC5B,UAAM,cAAc,mBAAmB,MAAM,CAAC,SAAS;AACrD,UAAI,MAAM;AACR,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ,KAAK;AAAA,UACb,OAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AACL,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO,MAAM,YAAY;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,eAAmC,QAAQ,OAAO;AAAA,IACtD,GAAG;AAAA,IACH,aAAa;AAAA,EACf,IAAI,CAAC,SAAS,CAAC;AAEf,MAAI,CAAC,UAAU,UAAU;AACvB,WAAO,oBAAC,WAAQ;AAAA,EAClB;AAEA,SACE,oBAAC,cAAc,UAAd,EAAuB,OAAO,cAC5B,UACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"sourcesContent":["'use client'\r\n\r\nimport React, { useState, useEffect, useMemo } from 'react'\r\nimport { TernSecureAuth } from '../utils/client-init'\r\nimport { onAuthStateChanged } from \"firebase/auth\"\r\nimport { TernSecureCtx, TernSecureState, TernSecureCtxValue } from './TernSecureCtx'\r\n\r\ninterface TernSecureClientProviderProps {\r\n children: React.ReactNode\r\n Loading?: React.ComponentType\r\n}\r\n\r\nexport function TernSecureClientProvider({ \r\n children,\r\n Loading = () => <div>Loading...</div>\r\n}: TernSecureClientProviderProps) {\r\n const [authState, setAuthState] = useState<TernSecureState>({\r\n userId: null,\r\n isLoaded: false,\r\n error: null,\r\n isSignedIn: false\r\n })\r\n\r\n useEffect(() => {\r\n const auth = TernSecureAuth();\r\n const unsubscribe = onAuthStateChanged(auth, (user) => {\r\n if (user) {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: true,\r\n userId: user.uid,\r\n error: null\r\n })\r\n } else {\r\n setAuthState({\r\n isLoaded: true,\r\n isSignedIn: false,\r\n userId: null,\r\n error: null\r\n })\r\n }\r\n })\r\n \r\n return () => unsubscribe()\r\n }, [])\r\n\r\n const contextValue: TernSecureCtxValue = useMemo(() => ({\r\n ...authState,\r\n }), [authState])\r\n\r\n if (!authState.isLoaded) {\r\n return <Loading />\r\n }\r\n\r\n return (\r\n <TernSecureCtx.Provider value={contextValue}>\r\n {children}\r\n </TernSecureCtx.Provider>\r\n )\r\n}\r\n\r\n"],"mappings":";AAckB;AAZlB,SAAgB,UAAU,WAAW,eAAe;AACpD,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,qBAA0D;AAO5D,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA,UAAU,MAAM,oBAAC,SAAI,wBAAU;AACjC,GAAmC;AACjC,QAAM,CAAC,WAAW,YAAY,IAAI,SAA0B;AAAA,IAC1D,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,EACd,CAAC;AAED,YAAU,MAAM;AACd,UAAM,OAAO,eAAe;AAC5B,UAAM,cAAc,mBAAmB,MAAM,CAAC,SAAS;AACrD,UAAI,MAAM;AACR,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ,KAAK;AAAA,UACb,OAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AACL,qBAAa;AAAA,UACX,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,QAAQ;AAAA,UACR,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAED,WAAO,MAAM,YAAY;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,eAAmC,QAAQ,OAAO;AAAA,IACtD,GAAG;AAAA,EACL,IAAI,CAAC,SAAS,CAAC;AAEf,MAAI,CAAC,UAAU,UAAU;AACvB,WAAO,oBAAC,WAAQ;AAAA,EAClB;AAEA,SACE,oBAAC,cAAc,UAAd,EAAuB,OAAO,cAC5B,UACH;AAEJ;","names":[]}
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  import { createContext, useContext } from "react";
3
- const INTERNAL_CONTEXT_KEY = Symbol("TERN_SECURE_CONTEXT");
4
3
  const TernSecureCtx = createContext(null);
5
4
  TernSecureCtx.displayName = "TernSecureCtx";
6
5
  const useTernSecure = (hookName) => {
7
6
  const context = useContext(TernSecureCtx);
8
- if (!context || context._contextKey !== INTERNAL_CONTEXT_KEY) {
7
+ if (!context) {
9
8
  throw new Error(
10
9
  `${hookName} must be used within TernSecureProvider`
11
10
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/boundary/TernSecureCtx.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { createContext, useContext } from 'react'\r\n\r\n// Core types\r\nexport interface TernSecureState {\r\n userId: string | null\r\n isLoaded: boolean\r\n error: string | null\r\n isSignedIn: boolean\r\n}\r\n\r\nexport type TernSecureCtxValue = TernSecureState & {\r\n _contextKey: symbol\r\n}\r\n\r\n// Context with proper null handling\r\nconst INTERNAL_CONTEXT_KEY = Symbol('TERN_SECURE_CONTEXT')\r\nexport const TernSecureCtx = createContext<TernSecureCtxValue | null>(null)\r\n\r\n// Set display name for better debugging\r\nTernSecureCtx.displayName = 'TernSecureCtx'\r\n\r\nexport const useTernSecure = (hookName: string) => {\r\n const context = useContext(TernSecureCtx)\r\n \r\n if (!context || context._contextKey !== INTERNAL_CONTEXT_KEY) {\r\n throw new Error(\r\n `${hookName} must be used within TernSecureProvider`\r\n )\r\n }\r\n\r\n return context\r\n}\r\n\r\n"],"mappings":";AAEA,SAAS,eAAe,kBAAkB;AAe1C,MAAM,uBAAuB,OAAO,qBAAqB;AAClD,MAAM,gBAAgB,cAAyC,IAAI;AAG1E,cAAc,cAAc;AAErB,MAAM,gBAAgB,CAAC,aAAqB;AACjD,QAAM,UAAU,WAAW,aAAa;AAExC,MAAI,CAAC,WAAW,QAAQ,gBAAgB,sBAAsB;AAC5D,UAAM,IAAI;AAAA,MACR,GAAG,QAAQ;AAAA,IACb;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/boundary/TernSecureCtx.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { createContext, useContext } from 'react'\r\n\r\n// Core types\r\nexport interface TernSecureState {\r\n userId: string | null\r\n isLoaded: boolean\r\n error: string | null\r\n isSignedIn: boolean\r\n}\r\n\r\nexport type TernSecureCtxValue = TernSecureState\r\n\r\n\r\nexport const TernSecureCtx = createContext<TernSecureCtxValue | null>(null)\r\n\r\n// Set display name for better debugging\r\nTernSecureCtx.displayName = 'TernSecureCtx'\r\n\r\nexport const useTernSecure = (hookName: string) => {\r\n const context = useContext(TernSecureCtx)\r\n \r\n if (!context) {\r\n throw new Error(\r\n `${hookName} must be used within TernSecureProvider`\r\n )\r\n }\r\n\r\n return context\r\n}\r\n\r\n"],"mappings":";AAEA,SAAS,eAAe,kBAAkB;AAanC,MAAM,gBAAgB,cAAyC,IAAI;AAG1E,cAAc,cAAc;AAErB,MAAM,gBAAgB,CAAC,aAAqB;AACjD,QAAM,UAAU,WAAW,aAAa;AAExC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,GAAG,QAAQ;AAAA,IACb;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"TernSecureClientProvider.d.ts","sourceRoot":"","sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAK3D,UAAU,6BAA6B;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC9B;AAID,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,OAAqC,EACtC,EAAE,6BAA6B,2CA6C/B"}
1
+ {"version":3,"file":"TernSecureClientProvider.d.ts","sourceRoot":"","sources":["../../../src/boundary/TernSecureClientProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAK3D,UAAU,6BAA6B;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC9B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,OAAqC,EACtC,EAAE,6BAA6B,2CA4C/B"}
@@ -4,9 +4,7 @@ export interface TernSecureState {
4
4
  error: string | null;
5
5
  isSignedIn: boolean;
6
6
  }
7
- export type TernSecureCtxValue = TernSecureState & {
8
- _contextKey: symbol;
9
- };
10
- export declare const TernSecureCtx: import("react").Context<TernSecureCtxValue | null>;
11
- export declare const useTernSecure: (hookName: string) => TernSecureCtxValue;
7
+ export type TernSecureCtxValue = TernSecureState;
8
+ export declare const TernSecureCtx: import("react").Context<TernSecureState | null>;
9
+ export declare const useTernSecure: (hookName: string) => TernSecureState;
12
10
  //# sourceMappingURL=TernSecureCtx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TernSecureCtx.d.ts","sourceRoot":"","sources":["../../../src/boundary/TernSecureCtx.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAID,eAAO,MAAM,aAAa,oDAAiD,CAAA;AAK3E,eAAO,MAAM,aAAa,aAAc,MAAM,uBAU7C,CAAA"}
1
+ {"version":3,"file":"TernSecureCtx.d.ts","sourceRoot":"","sources":["../../../src/boundary/TernSecureCtx.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAA;AAGhD,eAAO,MAAM,aAAa,iDAAiD,CAAA;AAK3E,eAAO,MAAM,aAAa,aAAc,MAAM,oBAU7C,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tern-secure/nextjs",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "packageManager": "npm@10.9.0",
5
5
  "publishConfig": {
6
6
  "access": "public"