UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

18 lines (16 loc) 378 B
import { useEffect } from 'react'; import useLogout from './useLogout'; /** * Log the user out and redirect them to login. * * To be used as a catch-all route for anonymous users in a secure app. * * @see CoreAdminRoutes */ export const LogoutOnMount = () => { const logout = useLogout(); useEffect(() => { logout(); }, [logout]); return null; };