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) {
|
||||
setManualVerificationLink(result.verificationUrl);
|
||||
try {
|
||||
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.",
|
||||
});
|
||||
if (
|
||||
typeof navigator !== "undefined" &&
|
||||
navigator.clipboard?.writeText
|
||||
) {
|
||||
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 {
|
||||
toastInfo({
|
||||
title: "Manual verification required",
|
||||
|
|
|
|||
Loading…
Reference in a new issue