fix: Incorrect error message when attempting to join team without error message

This commit is contained in:
Tom Moor
2023-12-20 18:47:43 -04:00
parent 56e6b5211a
commit 9fde70b924

View File

@@ -1,7 +1,6 @@
import invariant from "invariant";
import WelcomeEmail from "@server/emails/templates/WelcomeEmail";
import {
AuthenticationError,
InvalidAuthenticationError,
AuthenticationProviderDisabledError,
} from "@server/errors";
@@ -127,8 +126,7 @@ async function accountProvisioner({
throw AuthenticationProviderDisabledError();
}
try {
const result = await userProvisioner({
result = await userProvisioner({
name: userParams.name,
email: userParams.email,
isAdmin: isNewTeam || undefined,
@@ -147,6 +145,7 @@ async function accountProvisioner({
});
const { isNewUser, user } = result;
// TODO: Move to processor
if (isNewUser) {
await new WelcomeEmail({
to: user.email,
@@ -180,9 +179,6 @@ async function accountProvisioner({
isNewUser,
isNewTeam,
};
} catch (err) {
throw AuthenticationError(err.message);
}
}
export default traceFunction({