feat: Add optional notification email when invite is accepted (#3718)
* feat: Add optional notification email when invite is accepted * Refactor to use beforeSend
This commit is contained in:
@@ -40,7 +40,8 @@ export async function signIn(
|
||||
}
|
||||
|
||||
// update the database when the user last signed in
|
||||
user.updateSignedIn(ctx.request.ip);
|
||||
await user.updateSignedIn(ctx.request.ip);
|
||||
|
||||
// don't await event creation for a faster sign-in
|
||||
Event.create({
|
||||
name: "users.signin",
|
||||
|
||||
@@ -82,14 +82,7 @@ export async function getUserForEmailSigninToken(token: string): Promise<User> {
|
||||
}
|
||||
}
|
||||
|
||||
const user = await User.findByPk(payload.id, {
|
||||
include: [
|
||||
{
|
||||
model: Team,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
const user = await User.scope("withTeam").findByPk(payload.id);
|
||||
invariant(user, "User not found");
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user