update auth method config with enabled

This commit is contained in:
Zai Shi 2024-09-09 18:51:38 -07:00
parent 6acce31c65
commit eccebc2850

View File

@ -356,13 +356,16 @@ export const projectsCrudHandlers = createLazyProxy(() => createCrudHandlers(pro
},
});
} else if (!data.config.credential_enabled && passwordAuth) {
await tx.authMethodConfig.delete({
await tx.authMethodConfig.update({
where: {
projectConfigId_id: {
projectConfigId: oldProject.config.id,
id: passwordAuth.authMethodConfigId,
},
},
data: {
enabled: false,
},
});
}
}
@ -387,13 +390,16 @@ export const projectsCrudHandlers = createLazyProxy(() => createCrudHandlers(pro
},
});
} else if (!data.config.magic_link_enabled && otpAuth) {
await tx.authMethodConfig.delete({
await tx.authMethodConfig.update({
where: {
projectConfigId_id: {
projectConfigId: oldProject.config.id,
id: otpAuth.authMethodConfigId,
},
},
data: {
enabled: false,
},
});
}
}