import useUser from '../lib/useUser' import Layout from '../components/Layout' const SgProfile = () => { const { user } = useUser({ redirectTo: '/login' }) if (!user || user.isLoggedIn === false) { return loading... } return ( Your GitHub profile This page uses{' '} Static Generation (SG) {' '} and the /api/user route (using{' '} SWR) Public data, from{' '} {githubUrl(user.login)}, reduced to `login` and `avatar_url`. {JSON.stringify(user, null, 2)} ) } function githubUrl(login) { return `https://api.github.com/users/${login}` } export default SgProfile
Public data, from{' '} {githubUrl(user.login)}, reduced to `login` and `avatar_url`.
{JSON.stringify(user, null, 2)}