From 72ff66c98e1c1f6186da461be86210ae5c4d4f82 Mon Sep 17 00:00:00 2001 From: wonderlandpark Date: Fri, 7 May 2021 12:14:20 +0900 Subject: [PATCH] feat: added bug reporters --- pages/security.tsx | 41 ++++++++++++++++++++++++++++++++++------- utils/Constants.ts | 1 + 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/pages/security.tsx b/pages/security.tsx index 6e291fb..c008e38 100644 --- a/pages/security.tsx +++ b/pages/security.tsx @@ -1,10 +1,16 @@ -import { NextPage } from 'next' +import { GetServerSideProps, NextPage } from 'next' import dynamic from 'next/dynamic' -const Docs = dynamic(() => import('@components/Docs')) -const Button = dynamic(() => import('@components/Button')) +import { User } from '@types' +import { BUG_REPORTERS } from '@utils/Constants' +import { get } from '@utils/Query' -const Security: NextPage = () => { +const Docs = dynamic(() => import('@components/Docs')) +const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar')) +const Button = dynamic(() => import('@components/Button')) +const Divider = dynamic(() => import('@components/Divider')) + +const Security: NextPage = ({ bugReports }) => { return {
  • DoS 공격
  • 본인에게만 영향이 미치는 취약점(Self XSS 등)
  • -
    -

    취약점을 발견하셨나요?

    +

    취약점을 제보해주신 분들

    +
    + { + bugReports.filter(el=>el).map(u =>
    + + {u.username}#{u.tag} +
    ) + } +
    +
    +

    취약점을 발견하셨나요?

    } -export default Security \ No newline at end of file +export const getServerSideProps: GetServerSideProps = async () => { + return { + props: { + bugReports: await Promise.all(BUG_REPORTERS.map(u => get.user.load(u))) + } + } +} + +export default Security + +interface SecurityProps { + bugReports: User[] +} \ No newline at end of file diff --git a/utils/Constants.ts b/utils/Constants.ts index 06a302b..72e6dc9 100644 --- a/utils/Constants.ts +++ b/utils/Constants.ts @@ -3,6 +3,7 @@ import { KeyMap } from 'react-hotkeys' import { formatNumber, makeImageURL } from './Tools' export const VOTE_COOLDOWN = 12 * 60 * 60 * 1000 +export const BUG_REPORTERS = ['345265069132742657', '260303569591205888'] export const Status = { online: { text: '온라인',