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}`)

View file

@ -129,10 +129,6 @@ export default class AuthLogin extends React.Component<AuthLoginProps, AuthLogin
redirect(ctx, r || '/')
}
if (ctx.req.headers['user-agent'].contains('Discordbot')) {
redirect(ctx, '/_internal/_discordbot/_login')
}
ctx.robots = 'NOINDEX, NOFOLLOW'
if (r != null) {

BIN
ui/static/social.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB