flowlink-auth 2.6.9 → 2.7.1

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/init.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // src/init.js
2
2
  var CONFIG = null;
3
- function initflowlinkAuth({ publishableKey, baseUrl, opts } = {}) {
4
- if (!publishableKey) throw new Error("flowlink-auth: publishableKey is required in initflowlinkAuth()");
5
- if (!baseUrl) throw new Error("flowlink-auth: baseUrl is required in initflowlinkAuth()");
3
+ function initFlowlinkAuth({ publishableKey, baseUrl, opts } = {}) {
4
+ if (!publishableKey) throw new Error("flowlink-auth: publishableKey is required in initFlowlinkAuth()");
5
+ if (!baseUrl) throw new Error("flowlink-auth: baseUrl is required in initFlowlinkAuth()");
6
6
  if (!publishableKey.startsWith("pk_")) {
7
7
  console.warn('flowlink-auth: publishableKey should start with "pk_"');
8
8
  }
@@ -57,7 +57,7 @@ function getConfigSafe() {
57
57
  return CONFIG;
58
58
  }
59
59
  function getConfig() {
60
- if (!CONFIG) throw new Error("flowlink-auth: SDK not initialized. Call initflowlinkAuth(...) or wrap components in flowlinkAuthProvider with keys.");
60
+ if (!CONFIG) throw new Error("flowlink-auth: SDK not initialized. Call initFlowlinkAuth(...) or wrap components in FlowlinkAuthProvider with keys.");
61
61
  return CONFIG;
62
62
  }
63
63
  function getCSRFToken() {
@@ -67,7 +67,6 @@ export {
67
67
  getCSRFToken,
68
68
  getConfig,
69
69
  getConfigSafe,
70
- initflowlinkAuth,
70
+ initFlowlinkAuth,
71
71
  setConfigFromProvider
72
72
  };
73
-
package/dist/provider.js CHANGED
@@ -1041,7 +1041,7 @@ function getSafeErrorMessage(error) {
1041
1041
 
1042
1042
  // src/provider.js
1043
1043
  var AuthContext = (0, import_react.createContext)(null);
1044
- var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
1044
+ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
1045
1045
  const [ready, setReady] = (0, import_react.useState)(false);
1046
1046
  const [error, setError] = (0, import_react.useState)(null);
1047
1047
  const [user, setUser] = (0, import_react.useState)(null);
@@ -1210,10 +1210,10 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1210
1210
  };
1211
1211
  var useAuth = () => {
1212
1212
  const ctx = (0, import_react.useContext)(AuthContext);
1213
- if (!ctx) throw new Error("useAuth must be used within flowlinkAuthProvider");
1213
+ if (!ctx) throw new Error("useAuth must be used within FlowlinkAuthProvider");
1214
1214
  return ctx;
1215
1215
  };
1216
- var provider_default = flowlinkAuthProvider;
1216
+ var provider_default = FlowlinkAuthProvider;
1217
1217
  export {
1218
1218
  provider_default as default,
1219
1219
  useAuth
@@ -1231,4 +1231,3 @@ react/cjs/react.development.js:
1231
1231
  * LICENSE file in the root directory of this source tree.
1232
1232
  *)
1233
1233
  */
1234
-
@@ -99,4 +99,3 @@ export {
99
99
  validateOrigin,
100
100
  validatePasswordStrength
101
101
  };
102
-
package/dist/useAuth.js CHANGED
@@ -1030,7 +1030,7 @@ function checkSecureContext() {
1030
1030
  var AuthContext = (0, import_react.createContext)(null);
1031
1031
  var useAuth = () => {
1032
1032
  const ctx = (0, import_react.useContext)(AuthContext);
1033
- if (!ctx) throw new Error("useAuth must be used within flowlinkAuthProvider");
1033
+ if (!ctx) throw new Error("useAuth must be used within FlowlinkAuthProvider");
1034
1034
  return ctx;
1035
1035
  };
1036
1036
 
@@ -1054,4 +1054,3 @@ react/cjs/react.development.js:
1054
1054
  * LICENSE file in the root directory of this source tree.
1055
1055
  *)
1056
1056
  */
1057
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowlink-auth",
3
- "version": "2.6.9",
3
+ "version": "2.7.1",
4
4
  "description": "Custom auth library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,4 +28,4 @@
28
28
  "esbuild": "^0.27.0"
29
29
  }
30
30
  }
31
-
31
+