Fix onboarding tutorial visibility and apply security remediation tasks (ABV sanitization, i18n hardening, regex escaping)
This commit is contained in:
@@ -5,6 +5,7 @@ import { usePathname } from 'next/navigation';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { Scan, GlassWater, Users, Settings, ArrowRight, X, Sparkles } from 'lucide-react';
|
||||
import { useI18n } from '@/i18n/I18nContext';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
|
||||
const ONBOARDING_KEY = 'dramlog_onboarding_complete';
|
||||
|
||||
@@ -50,12 +51,22 @@ const getSteps = (t: (path: string) => string): OnboardingStep[] => [
|
||||
|
||||
export default function OnboardingTutorial() {
|
||||
const { t } = useI18n();
|
||||
const { user, isLoading } = useAuth();
|
||||
const STEPS = getSteps(t);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [currentStep, setCurrentStep] = useState(0);
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
// Don't show if auth is still loading
|
||||
if (isLoading) return;
|
||||
|
||||
// Don't show if no user is logged in
|
||||
if (!user) {
|
||||
setIsOpen(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't show on login/auth pages
|
||||
if (pathname === '/login' || pathname === '/auth' || pathname === '/register') {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user