remove demo code

This commit is contained in:
2026-01-03 11:38:51 +01:00
parent 2f21dc4595
commit 9a7efa496f
38 changed files with 1535 additions and 1157 deletions

View File

@@ -12,9 +12,7 @@ import {
LogIn,
AlertCircle,
Flag,
Gamepad2,
Shield,
ChevronRight,
} from 'lucide-react';
import Card from '@/components/ui/Card';
@@ -97,31 +95,6 @@ export default function LoginPage() {
},
});
const handleDemoLogin = async () => {
try {
const { ServiceFactory } = await import('@/lib/services/ServiceFactory');
const serviceFactory = new ServiceFactory(process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3001');
const authService = serviceFactory.createAuthService();
// Get rememberMe value safely
const rememberMe = formState.fields.rememberMe?.value ?? false;
await authService.demoLogin({
role: 'driver',
rememberMe,
});
await new Promise(resolve => setTimeout(resolve, 500));
router.push(returnTo);
} catch (error) {
setFormError('Demo login failed. Please try again.');
logErrorWithContext(error, {
component: 'LoginPage',
action: 'demo-login',
});
}
};
return (
<main className="min-h-screen bg-deep-graphite flex">
{/* Background Pattern */}
@@ -164,8 +137,7 @@ export default function LoginPage() {
<span>Secure login</span>
</div>
<div className="flex items-center gap-2">
<Gamepad2 className="w-4 h-4" />
<span>iRacing verified</span>
<span className="text-sm">iRacing verified</span>
</div>
</div>
</div>
@@ -317,20 +289,6 @@ export default function LoginPage() {
</div>
</div>
{/* Demo Login */}
<motion.button
type="button"
onClick={handleDemoLogin}
disabled={formState.isSubmitting}
whileHover={{ scale: 1.01 }}
whileTap={{ scale: 0.99 }}
className="w-full flex items-center justify-center gap-3 px-4 py-3 rounded-lg bg-gradient-to-r from-deep-graphite to-iron-gray border border-charcoal-outline text-gray-300 hover:border-primary-blue/30 transition-all disabled:opacity-50 group"
>
<Gamepad2 className="w-5 h-5 text-primary-blue" />
<span>Demo Login</span>
<ChevronRight className="w-4 h-4 text-gray-500 group-hover:translate-x-0.5 transition-transform" />
</motion.button>
{/* Sign Up Link */}
<p className="mt-6 text-center text-sm text-gray-400">
Don't have an account?{' '}

View File

@@ -15,13 +15,11 @@ import {
User,
Check,
X,
Gamepad2,
Loader2,
Car,
Users,
Trophy,
Shield,
ChevronRight,
Sparkles,
} from 'lucide-react';
@@ -239,26 +237,6 @@ export default function SignupPage() {
}
};
const handleDemoLogin = async () => {
setLoading(true);
try {
const { ServiceFactory } = await import('@/lib/services/ServiceFactory');
const serviceFactory = new ServiceFactory(process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3001');
const authService = serviceFactory.createAuthService();
await authService.demoLogin({ role: 'driver' });
await new Promise(resolve => setTimeout(resolve, 500));
// Always redirect to dashboard after demo login
router.push('/dashboard');
} catch {
setErrors({
submit: 'Demo login failed. Please try again.',
});
setLoading(false);
}
};
// Show loading while checking auth
if (checkingAuth) {
return (
@@ -344,7 +322,6 @@ export default function SignupPage() {
<span>Secure signup</span>
</div>
<div className="flex items-center gap-2">
<Gamepad2 className="w-4 h-4" />
<span>iRacing integration</span>
</div>
</div>
@@ -596,24 +573,10 @@ export default function SignupPage() {
<div className="w-full border-t border-charcoal-outline" />
</div>
<div className="relative flex justify-center text-xs">
<span className="px-4 bg-iron-gray text-gray-500">or sign up with</span>
<span className="px-4 bg-iron-gray text-gray-500">or continue with</span>
</div>
</div>
{/* Demo Login */}
<motion.button
type="button"
onClick={handleDemoLogin}
disabled={loading}
whileHover={{ scale: 1.01 }}
whileTap={{ scale: 0.99 }}
className="w-full flex items-center justify-center gap-3 px-4 py-3 rounded-lg bg-gradient-to-r from-deep-graphite to-iron-gray border border-charcoal-outline text-gray-300 hover:border-primary-blue/30 transition-all disabled:opacity-50 group"
>
<Gamepad2 className="w-5 h-5 text-primary-blue" />
<span>Demo Login</span>
<ChevronRight className="w-4 h-4 text-gray-500 group-hover:translate-x-0.5 transition-transform" />
</motion.button>
{/* Login Link */}
<p className="mt-6 text-center text-sm text-gray-400">
Already have an account?{' '}