import React , { useEffect } from 'react' ; import { useRouter } from 'next/router' ; const AuthSuccess = ( ) => { const router = useRouter ( ) ; useEffect ( ( ) => { router . prefetch ( '/' ) ; router . push ( window . localStorage . getItem ( 'redirectPath' ) ?? `/` ) ; } , [ ] ) ; return < div > < /div>; } ; export default AuthSuccess ;