mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 10:19:10 +00:00
auth: add slugs and auth redirects
This commit is contained in:
parent
f7d1f578ad
commit
1a7b042351
3 changed files with 79 additions and 10 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue