diff --git a/src/components/DeviceLoginForm.tsx b/src/components/DeviceLoginForm.tsx index 0a05e46d3..77ed06449 100644 --- a/src/components/DeviceLoginForm.tsx +++ b/src/components/DeviceLoginForm.tsx @@ -318,12 +318,28 @@ export default function DeviceLoginForm({
{ + event.preventDefault(); + const pastedText = + event.clipboardData.getData( + "text" + ); + const cleanedValue = + pastedText + .replace( + /[^a-zA-Z0-9]/g, + "" + ) + .toUpperCase() + .slice(0, 8); + field.onChange(cleanedValue); + }} onChange={(value) => { // Strip hyphens and convert to uppercase const cleanedValue = value