Fix page not loading with ending the request (#6546)

This commit is contained in:
Marton Langa 2019-03-07 17:29:25 +07:00 committed by Tim Neutkens
parent abad29b413
commit 0a4f0e6356

View file

@ -50,7 +50,7 @@ Profile.getInitialProps = async ctx => {
const redirectOnError = () => const redirectOnError = () =>
process.browser process.browser
? Router.push('/login') ? Router.push('/login')
: ctx.res.writeHead(301, { Location: '/login' }) : ctx.res.writeHead(301, { Location: '/login' }).end()
try { try {
const response = await fetch(apiUrl, { const response = await fetch(apiUrl, {