further social improvements, client-render edge cases

This commit is contained in:
41666 2019-03-21 08:13:58 -05:00
parent dd07e6bac4
commit 1c784d0605
4 changed files with 9 additions and 7 deletions

View file

@ -34,7 +34,7 @@ const Hider = styled.div`
class Server extends React.Component<ServerPageProps> {
static async getInitialProps (ctx: *, rpc: *, router: *) {
const isDiscordBot = ctx.req.headers['user-agent'].includes('Discordbot')
const isDiscordBot = ctx.req && ctx.req.headers['user-agent'].includes('Discordbot')
if (ctx.user == null) {
if (!isDiscordBot) {
redirect(ctx, `/auth/login?r=${router.asPath}`)