Skip to content

Commit

Permalink
fix: eamil is set as expired when email is not a beta.gouv.fr address
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasCharrier committed Nov 21, 2024
1 parent b965760 commit dfa7889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/schedulers/setEmailExpired.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as utils from "@controllers/utils";
export async function setEmailExpired(
optionalExpiredUsers?: memberBaseInfoSchemaType[]
) {
// set email that are not beta.gouv.fr as expired
let expiredUsers = optionalExpiredUsers;
let dbUsers: memberBaseInfoSchemaType[] = [];
if (!expiredUsers) {
Expand All @@ -26,7 +27,7 @@ export async function setEmailExpired(
user.primary_email_status === EmailStatusCode.EMAIL_SUSPENDED &&
user.primary_email_status_updated_at < todayLess30days &&
user.primary_email &&
user.primary_email.includes(`@${config.domain}`)
!user.primary_email.includes(`@${config.domain}`)
);
}
for (const user of dbUsers) {
Expand Down

0 comments on commit dfa7889

Please sign in to comment.