Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa538355ae | |||
| 1a2043eaae |
@@ -454,7 +454,14 @@ function OtpVerify({ account, email, initialChannel = "email", remember, setReme
|
|||||||
if (!PHONE_RE.test(phone)) { setError("Enter your phone in international format, e.g. +14155550100."); return; }
|
if (!PHONE_RE.test(phone)) { setError("Enter your phone in international format, e.g. +14155550100."); return; }
|
||||||
await sendPhoneOtp(phone); setSent(true);
|
await sendPhoneOtp(phone); setSent(true);
|
||||||
}
|
}
|
||||||
} catch (e) { setError((e as Error).message); }
|
} catch (e) {
|
||||||
|
// gotrue can throw an error whose message is an unhelpful "{}"/JSON blob (e.g. a
|
||||||
|
// 500 "Error sending magic link email" when SMTP isn't set up). Show something
|
||||||
|
// readable and actionable instead of the raw payload.
|
||||||
|
const raw = (e as { message?: unknown })?.message;
|
||||||
|
const readable = typeof raw === "string" && raw.trim() && !raw.trim().startsWith("{") ? raw.trim() : "";
|
||||||
|
setError(readable || "We couldn't send your sign-in code right now. Please try again shortly, or sign in with your password.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function complete(code: string) {
|
async function complete(code: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user