fix: payload cleanup (#13552)
* fix: payload cleanup * Update eventType.ts * Send whitelisted fields everywhere * Removed a user select * Removed extra usage of users * Put back user field with fewer selects * Added user pick * Removed more users selects * Another select removal --------- Co-authored-by: Hariom <[email protected]> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
19 files changed
+230
-48
No files matched your search
@@ -47,7 +47,7 @@ const loginWithTotp = async (user: { email: string }) =>
|
||||
|
||||
type UserTeams = {
|
||||
teams: (Membership & {
|
||||
team: Team;
|
||||
team: Pick<Team, "metadata">;
|
||||
})[];
|
||||
};
|
||||
|
||||
@@ -106,7 +106,9 @@ const providers: Provider[] = [
|
||||
throw new Error(ErrorCode.InternalServerError);
|
||||
}
|
||||
|
||||
const user = await UserRepository.findByEmailAndIncludeProfiles({ email: credentials.email });
|
||||
const user = await UserRepository.findByEmailAndIncludeProfilesAndPassword({
|
||||
email: credentials.email,
|
||||
});
|
||||
// Don't leak information about it being username or password that is invalid
|
||||
if (!user) {
|
||||
throw new Error(ErrorCode.IncorrectEmailPassword);
|
||||
@@ -273,7 +275,9 @@ if (isSAMLLoginEnabled) {
|
||||
email?: string;
|
||||
locale?: string;
|
||||
}) => {
|
||||
const user = await UserRepository.findByEmailAndIncludeProfiles({ email: profile.email || "" });
|
||||
const user = await UserRepository.findByEmailAndIncludeProfilesAndPassword({
|
||||
email: profile.email || "",
|
||||
});
|
||||
if (!user) {
|
||||
throw new Error(ErrorCode.UserNotFound);
|
||||
}
|
||||
@@ -339,7 +343,7 @@ if (isSAMLLoginEnabled) {
|
||||
}
|
||||
|
||||
const { id, firstName, lastName, email } = userInfo;
|
||||
const user = await UserRepository.findByEmailAndIncludeProfiles({ email });
|
||||
const user = await UserRepository.findByEmailAndIncludeProfilesAndPassword({ email });
|
||||
if (!user) {
|
||||
throw new Error(ErrorCode.UserNotFound);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user