From af13790c93545ad9eee7287848f87541685c10e4 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 20 May 2026 16:28:12 -0700 Subject: [PATCH] Fix pasting the device code not working --- src/components/DeviceLoginForm.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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