()
| 59 | }; |
| 60 | |
| 61 | const sendCode = async () => { |
| 62 | if (!isValidEmail(email) || sending || resendCountdown > 0) return; |
| 63 | setSending(true); |
| 64 | try { |
| 65 | await useAppStore |
| 66 | .getState() |
| 67 | .sendEmailLoginCode(email, resolveWorkspaceName()); |
| 68 | setStep("code"); |
| 69 | startCountdown(); |
| 70 | } catch (e) { |
| 71 | pushNotification({ |
| 72 | module: "bytebase", |
| 73 | style: "CRITICAL", |
| 74 | title: t("auth.sign-in.failed-to-send-code", { error: String(e) }), |
| 75 | }); |
| 76 | } finally { |
| 77 | setSending(false); |
| 78 | } |
| 79 | }; |
| 80 | |
| 81 | const submitCode = (parts: string[]) => { |
| 82 | const code = parts.join(""); |
no test coverage detected