import getServerCredential from '@/common/libs/getServerCredential'
import { redirect } from 'next/navigation'
import React from 'react'

const Authenticated = ({ children }: { children: React.ReactNode }) => {
  const credential = getServerCredential()

  if (!credential) redirect('/login')

  return children
}

export default Authenticated