Guard clipboard usage
cgen-e718117cd4404689a6e055734d1fc3b6
This commit is contained in:
parent
979c16d6e1
commit
303f8091ea
1 changed files with 13 additions and 6 deletions
|
|
@ -68,12 +68,19 @@ export default function Login() {
|
||||||
} else if (result?.verificationUrl) {
|
} else if (result?.verificationUrl) {
|
||||||
setManualVerificationLink(result.verificationUrl);
|
setManualVerificationLink(result.verificationUrl);
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard?.writeText(result.verificationUrl);
|
if (
|
||||||
toastInfo({
|
typeof navigator !== "undefined" &&
|
||||||
title: "Verification link copied",
|
navigator.clipboard?.writeText
|
||||||
description:
|
) {
|
||||||
"We copied the manual verification link to your clipboard. Paste it into your browser to finish signup.",
|
await navigator.clipboard.writeText(result.verificationUrl);
|
||||||
});
|
toastInfo({
|
||||||
|
title: "Verification link copied",
|
||||||
|
description:
|
||||||
|
"We copied the manual verification link to your clipboard. Paste it into your browser to finish signup.",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error("clipboard unsupported");
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
toastInfo({
|
toastInfo({
|
||||||
title: "Manual verification required",
|
title: "Manual verification required",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue