fix: URL case sensitive bug (#9886)
parent
cc99e1697b
commit
c412e7f815
|
@ -93,16 +93,18 @@ async function getDynamicGroupPageProps(context: GetServerSidePropsContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUserPageProps(context: GetServerSidePropsContext) {
|
async function getUserPageProps(context: GetServerSidePropsContext) {
|
||||||
const { user: username, type: slug } = paramsSchema.parse(context.params);
|
const { user: uname, type: slug } = paramsSchema.parse(context.params);
|
||||||
const { rescheduleUid } = context.query;
|
const { rescheduleUid } = context.query;
|
||||||
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req.headers.host ?? "");
|
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req.headers.host ?? "");
|
||||||
|
|
||||||
|
/** TODO: We should standarize this */
|
||||||
|
const username = uname.toLowerCase().replace(/( |%20)/g, "+");
|
||||||
|
|
||||||
const { ssrInit } = await import("@server/lib/ssr");
|
const { ssrInit } = await import("@server/lib/ssr");
|
||||||
const ssr = await ssrInit(context);
|
const ssr = await ssrInit(context);
|
||||||
const user = await prisma.user.findFirst({
|
const user = await prisma.user.findFirst({
|
||||||
where: {
|
where: {
|
||||||
/** TODO: We should standarize this */
|
username,
|
||||||
username: username.toLowerCase().replace(/( |%20)/g, "+"),
|
|
||||||
organization: isValidOrgDomain
|
organization: isValidOrgDomain
|
||||||
? {
|
? {
|
||||||
slug: currentOrgDomain,
|
slug: currentOrgDomain,
|
||||||
|
|
Loading…
Reference in New Issue