AdminNavbarLinks.js:
if (profile && profile.admin !== true && window.location.href.indexOf('/admin') !== -1)
{ router.push('/login') }
const withSession = Component => props => (
<Query query={GET_ME}>
{({ data, loading, refetch }) => (
<Component
{...props}
loading={loading}
session={data}
refetch={refetch}
/>
)}
</Query>
)
export default withSession
Comments
Post a Comment