remove demo code
This commit is contained in:
@@ -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?{' '}
|
||||
|
||||
Reference in New Issue
Block a user