[dyad] Fixed TypeScript errors in auth listeners - wrote 3 file(s)

This commit is contained in:
[dyad]
2026-01-30 09:54:40 +01:00
parent 41e368dce5
commit 9f97bf6fd0
3 changed files with 6 additions and 4 deletions

View File

@@ -7,12 +7,13 @@ import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { KeyRound } from "lucide-react";
import type { AuthChangeEvent, Session } from "@supabase/supabase-js";
export default function LoginPage() {
const router = useRouter();
useEffect(() => {
const { data: { subscription } } = supabase.auth.onAuthStateChange((event, session) => {
const { data: { subscription } } = supabase.auth.onAuthStateChange((_event: AuthChangeEvent, session: Session | null) => {
if (session) {
router.push('/');
}

View File

@@ -5,6 +5,7 @@ import { useRouter } from 'next/navigation';
import { supabase } from '@/integrations/supabase/client';
import { VideoEditor } from "@/components/video-editor";
import { Loader2 } from 'lucide-react';
import type { AuthChangeEvent, Session } from '@supabase/supabase-js';
export default function Home() {
const router = useRouter();
@@ -22,7 +23,7 @@ export default function Home() {
checkSession();
const { data: { subscription } } = supabase.auth.onAuthStateChange((event, session) => {
const { data: { subscription } } = supabase.auth.onAuthStateChange((event: AuthChangeEvent, _session: Session | null) => {
if (event === 'SIGNED_OUT') {
router.push('/login');
}