@matchain/matchid-sdk-react 0.1.51-alpha.2 → 0.1.51

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.
@@ -3256,11 +3256,11 @@ function useUserInfo() {
3256
3256
  };
3257
3257
  const getLoginEmailCode = async (email) => {
3258
3258
  const res = await getEmailCodeApi(email);
3259
- if (res && res.data && isSuccess(res)) {
3259
+ if (isSuccess(res)) {
3260
3260
  window.sessionStorage.setItem("loginkey", res.data.key);
3261
3261
  return res.data.key;
3262
3262
  }
3263
- return "";
3263
+ throw new Error(res.message);
3264
3264
  };
3265
3265
  const loginByEmail = async ({
3266
3266
  email,
@@ -3445,8 +3445,8 @@ function StepVerify(props) {
3445
3445
  try {
3446
3446
  setError("");
3447
3447
  setSending(true);
3448
- sendTimeRef.current = intervalTime;
3449
3448
  await getLoginEmailCode(props.email);
3449
+ sendTimeRef.current = intervalTime;
3450
3450
  setSendBtnText(`${sendTimeRef.current}s`);
3451
3451
  intervalRef.current = setInterval(() => {
3452
3452
  sendTimeRef.current--;