"use client";

import { useEffect } from "react";
import { useDispatch } from "react-redux";
import { validateAuth } from "./auth/authSlice";
import { AppDispatch } from "./types";

export function InitializeAuth() {
  const dispatch = useDispatch<AppDispatch>();

  useEffect(() => {
    dispatch(validateAuth());
  }, [dispatch]);

  return null;
}
