fix: use completeRegistration for incomplete OTP setup in login flow

- LoginPage: call completeRegistration instead of verifyOTP when qrCodeURL exists
- This ensures otp_verified is set to true for users completing OTP setup
- Backend: reorder maxUsers check to allow existing incomplete users to continue
- Backend: return OTP info when login with incomplete OTP setup
This commit is contained in:
tinkle-community
2026-01-07 20:15:27 +08:00
parent 138943d6fb
commit e92222950a
12 changed files with 477 additions and 310 deletions

View File

@@ -1,5 +1,6 @@
import { motion } from 'framer-motion'
import { TrendingUp, Layers, Zap, Hexagon, Crosshair } from 'lucide-react'
import { useAuth } from '../../../contexts/AuthContext'
const agents = [
{
@@ -43,7 +44,15 @@ const agents = [
]
export default function AgentGrid() {
// Simplified State to prevent crash
const { user } = useAuth()
const handleInitialize = () => {
if (user) {
window.location.href = '/strategy-market'
} else {
window.location.href = '/login'
}
}
return (
<section id="market-scanner" className="py-16 md:py-24 bg-nofx-bg relative overflow-hidden">
@@ -118,7 +127,10 @@ export default function AgentGrid() {
</div>
{/* Action Btn */}
<button className={`w-full py-4 text-xs font-bold font-mono uppercase tracking-[0.2em] border border-zinc-700 hover:border-${agent.color === 'text-nofx-gold' ? 'nofx-gold' : 'white'} hover:bg-white/5 transition-all flex items-center justify-center gap-2 group-hover:text-white`}>
<button
onClick={handleInitialize}
className={`w-full py-4 text-xs font-bold font-mono uppercase tracking-[0.2em] border border-zinc-700 hover:border-${agent.color === 'text-nofx-gold' ? 'nofx-gold' : 'white'} hover:bg-white/5 transition-all flex items-center justify-center gap-2 group-hover:text-white cursor-pointer`}
>
<span className={agent.color}>[</span> INITIALIZE <span className={agent.color}>]</span>
</button>
</div>

View File

@@ -174,7 +174,7 @@ export default function TerminalHero() {
{/* Main Title - Massive & Impactful */}
{/* Main Title - Massive & Impactful */}
<div className="relative z-20 mix-blend-hard-light md:mix-blend-normal">
<h1 className="text-6xl sm:text-6xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-[0.9] md:leading-[0.8] mb-6 select-none bg-clip-text text-transparent bg-gradient-to-b from-white via-white to-zinc-600 drop-shadow-2xl">
<h1 className="text-5xl sm:text-6xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-[0.9] md:leading-[0.8] mb-6 select-none bg-clip-text text-transparent bg-gradient-to-b from-white via-white to-zinc-600 drop-shadow-2xl">
AGENTIC<br />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-nofx-gold via-white to-nofx-gold animate-shimmer bg-[length:200%_auto] tracking-tight filter drop-shadow-[0_0_15px_rgba(234,179,8,0.3)]">TRADING</span>
</h1>
@@ -344,14 +344,14 @@ function CommunityStats() {
const stats = [
{
label: 'GITHUB STARS',
value: isLoading ? '...' : (error ? '9.5k+' : stars.toLocaleString()),
value: isLoading ? '...' : (error ? '9,700+' : stars.toLocaleString()),
icon: Star,
color: 'text-yellow-400',
href: OFFICIAL_LINKS.github
},
{
label: 'FORKS',
value: isLoading ? '...' : (error ? '2.5k+' : forks.toLocaleString()),
value: isLoading ? '...' : (error ? '2,600+' : forks.toLocaleString()),
icon: GitFork,
color: 'text-blue-400',
href: `${OFFICIAL_LINKS.github}/fork`
@@ -365,7 +365,7 @@ function CommunityStats() {
},
{
label: 'DEV COMMUNITY',
value: '5,800+', // Hardcoded as per user request
value: '6,000+', // Updated as per user request
icon: MessageCircle,
color: 'text-blue-500',
href: OFFICIAL_LINKS.telegram