Tidying
This commit is contained in:
parent
45ffd5a1cc
commit
f4c90e9f6b
|
@ -15,9 +15,10 @@ import { authenticateOnServer } from 'web/lib/firebase/server-auth'
|
|||
|
||||
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||
const creds = await authenticateOnServer(ctx)
|
||||
const username = ctx.params!.username as string // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
const [auth, user] = (await Promise.all([
|
||||
creds != null ? getUserAndPrivateUser(creds.user.uid) : null,
|
||||
getUserByUsername(ctx.params!.username as string), // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
getUserByUsername(username),
|
||||
])) as [UserAndPrivateUser | null, User | null]
|
||||
return { props: { auth, user } }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user