User email as impersonation if username is null (#7250)

This commit is contained in:
sean-brydon authored and GitHub committed 2023-02-21 17:12:26 +00:00
1 parent bfc81b770a
commit c8019edb57
2 files changed
+8 -7

No files matched your search

@@ -5,7 +5,8 @@ import { useState } from "react";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { RouterOutputs, trpc } from "@calcom/trpc/react";
import type { RouterOutputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import {
Avatar,
@@ -251,7 +252,7 @@ export default function MemberListItem(props: Props) {
onSubmit={async (e) => {
e.preventDefault();
await signIn("impersonation-auth", {
username: props.member.username,
username: props.member.username || props.member.email,
teamId: props.team.id,
});
setShowImpersonateModal(false);