MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / sendVerificationCode

Function sendVerificationCode

web/src/components/auth/RegisterForm.js:168–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166 }
167
168 const sendVerificationCode = async () => {
169 if (inputs.email === '') return;
170 if (turnstileEnabled && turnstileToken === '') {
171 showInfo('请稍后几秒重试,Turnstile 正在检查用户环境!');
172 return;
173 }
174 setVerificationCodeLoading(true);
175 try {
176 const res = await API.get(
177 `/api/verification?email=${inputs.email}&turnstile=${turnstileToken}`,
178 );
179 const { success, message } = res.data;
180 if (success) {
181 showSuccess('验证码发送成功,请检查你的邮箱!');
182 } else {
183 showError(message);
184 }
185 } catch (error) {
186 showError('发送验证码失败,请重试');
187 } finally {
188 setVerificationCodeLoading(false);
189 }
190 };
191
192 const handleGitHubClick = () => {
193 setGithubLoading(true);

Callers

nothing calls this directly

Calls 3

showInfoFunction · 0.90
showSuccessFunction · 0.90
showErrorFunction · 0.90

Tested by

no test coverage detected