Team invites - transform email or username to lower case (#6470)
* Fix string * Use current hashPassword * Transform email to lowercase Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a4d6f7da62
commit
f96e909dce
3 files changed
+5
-5
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { IdentityProvider } from "@prisma/client";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { hashPassword } from "@calcom/lib/auth";
|
||||
import { closeComUpsertTeamUser } from "@calcom/lib/sync/SyncServiceManager";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
import { hashPassword } from "@lib/auth";
|
||||
import slugify from "@lib/slugify";
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { z } from "zod";
|
||||
|
||||
import MemberInvitationModal from "@calcom/features/ee/teams/components/MemberInvitationModal";
|
||||
import { classNames } from "@calcom/lib";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { WEBAPP_URL, APP_NAME } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { RouterOutputs, trpc } from "@calcom/trpc/react";
|
||||
import { Avatar, Badge, Button, Icon, showToast, SkeletonContainer, SkeletonText } from "@calcom/ui";
|
||||
@@ -156,7 +156,7 @@ const PendingMemberItem = (props: { member: TeamMember; index: number; teamId: n
|
||||
{member.username ? (
|
||||
<p className="text-gray-600">{`${WEBAPP_URL}/${member.username}`}</p>
|
||||
) : (
|
||||
<p className="text-gray-600">{t("not_on_cal")}</p>
|
||||
<p className="text-gray-600">{t("not_on_cal", { appName: APP_NAME })}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -251,7 +251,7 @@ export const viewerTeamsRouter = router({
|
||||
.input(
|
||||
z.object({
|
||||
teamId: z.number(),
|
||||
usernameOrEmail: z.string(),
|
||||
usernameOrEmail: z.string().transform((usernameOrEmail) => usernameOrEmail.toLowerCase()),
|
||||
role: z.nativeEnum(MembershipRole),
|
||||
language: z.string(),
|
||||
sendEmailInvitation: z.boolean(),
|
||||
@@ -321,7 +321,7 @@ export const viewerTeamsRouter = router({
|
||||
from: ctx.user.name,
|
||||
to: input.usernameOrEmail,
|
||||
teamName: team.name,
|
||||
joinLink: `${WEBAPP_URL}/signup?token=${token}&callbackUrl=/settings/teams`,
|
||||
joinLink: `${WEBAPP_URL}/signup?token=${token}&callbackUrl=/teams`,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user