auth: add slugs and auth redirects

This commit is contained in:
41666 2019-03-20 05:39:36 -05:00
parent f7d1f578ad
commit 1a7b042351
3 changed files with 79 additions and 10 deletions

View file

@ -3,8 +3,17 @@ import * as React from 'react'
import Head from 'next/head'
import type { PageProps } from '../../types'
import SocialCards from '../../components/social-cards'
import redirect from '../../lib/redirect'
export default class Server extends React.Component<PageProps> {
static async getInitialProps (ctx: *, rpc: *, router: *) {
if (ctx.user == null) {
redirect(ctx, `/auth/login?r=${router.asPath}`)
}
ctx.robots = 'NOINDEX, NOFOLLOW'
}
render () {
return (
<div>