fix: Incorrect error message when attempting to join team without error message
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user