@@ -64,8 +102,8 @@ function DeveloperLoginPage() {
)
}
- // Magic link sent confirmation
- if (magicLinkSent) {
+ // OTP verification screen
+ if (otpSent) {
return (
Check your email
-
- We sent a magic link to {email} .
- Click the link in the email to sign in.
+
+ We sent a sign-in link and code to
-
{ setMagicLinkSent(false); setMode('login') }}
- className="text-sm text-[#00ef8b] hover:text-[#00ef8b]/80 transition-colors"
- >
- Back to sign in
-
+
{email}
+
+ {/* OTP Input */}
+
Enter the 6-digit code:
+
+ {error && (
+
+ {error}
+
+ )}
+
+
+ {otp.map((digit, i) => (
+ { otpRefs.current[i] = el }}
+ type="text"
+ inputMode="numeric"
+ maxLength={6}
+ value={digit}
+ onChange={e => handleOtpChange(i, e.target.value)}
+ onKeyDown={e => handleOtpKeyDown(i, e)}
+ disabled={verifying}
+ className="w-11 h-13 text-center text-xl font-bold bg-neutral-800 border border-neutral-700 rounded-lg text-[#00ef8b] focus:outline-none focus:border-[#00ef8b]/50 focus:ring-1 focus:ring-[#00ef8b]/20 transition-colors disabled:opacity-50"
+ autoFocus={i === 0}
+ />
+ ))}
+
+
+ {verifying && (
+
+
+ Verifying...
+
+ )}
+
+
+
Or click the magic link in your email
+
+ { setOtpSent(false); setOtp(['', '', '', '', '', '']); setError(null) }}
+ className="text-[#00ef8b] hover:text-[#00ef8b]/80 transition-colors"
+ >
+ Use a different email
+
+ |
+ {
+ setError(null)
+ setLoading(true)
+ try {
+ await sendMagicLink(email)
+ setOtp(['', '', '', '', '', ''])
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'Failed to resend')
+ } finally {
+ setLoading(false)
+ }
+ }}
+ disabled={loading}
+ className="text-neutral-400 hover:text-white transition-colors disabled:opacity-50"
+ >
+ {loading ? 'Sending...' : 'Resend code'}
+
+
+
)
}
- const titles: Record