@zoreal/oauth2-react 0.2.7 → 0.2.8

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.cjs CHANGED
@@ -39,7 +39,7 @@ var import_react2 = require("react");
39
39
 
40
40
  // src/wire.ts
41
41
  var WIRE_VERSION = 1;
42
- var SDK_VERSION = "0.2.7";
42
+ var SDK_VERSION = "0.2.8";
43
43
  var DEFAULT_ISSUER = "https://id.zoreal.com";
44
44
  var POLL_INTERVAL_MS = 2e3;
45
45
  var POLL_INTERVAL_ENROLLING_MS = 5e3;
@@ -1589,7 +1589,8 @@ var TEXTS = {
1589
1589
  continue_with: "Continue with ZOREAL",
1590
1590
  signin_with: "Sign in with ZOREAL",
1591
1591
  signup_with: "Sign up with ZOREAL",
1592
- signin: "Sign in"
1592
+ signin: "Sign in",
1593
+ verify_with: "Verify with ZOREAL ID"
1593
1594
  };
1594
1595
  var SIZES = {
1595
1596
  large: { height: 44, font: 15, pad: 20 },
@@ -1609,12 +1610,14 @@ function ZorealLogin(props) {
1609
1610
  logo_alignment = "left",
1610
1611
  width,
1611
1612
  click_listener,
1613
+ flow = "browser-direct",
1612
1614
  ...request
1613
1615
  } = props;
1614
1616
  const { login } = useZorealFlow({
1615
1617
  ...request,
1616
- flow: "browser-direct",
1617
- onCredential: onSuccess,
1618
+ flow,
1619
+ onCredential: flow === "browser-direct" ? onSuccess : void 0,
1620
+ onCode: flow === "auth-code" ? onSuccess : void 0,
1618
1621
  onError: (e) => onError?.({ type: "unknown", description: e.description ?? e.error }),
1619
1622
  onNonOAuthError: (e) => onError?.(e)
1620
1623
  });