17 lines
351 B
TypeScript
17 lines
351 B
TypeScript
"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;
|
|
}
|