0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(console): avoid updating mfa config on sie config page (#4502)

This commit is contained in:
Xiao Yijun 2023-09-14 16:17:35 +08:00 committed by GitHub
parent 17fd64e643
commit 2a64e7f32d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -116,9 +116,19 @@ function SignInExperience() {
}
}
/**
* Note: extract `mfa` since it will not be updated on the SIE config page.
* This is a temporary solution, we will split `SignInExperience` type into multiple types
* when the SIE config page is split into multiple pages.
*/
const { mfa, ...payload } = parser.onboardSieConfigToSignInExperience(
formData,
signInExperience
);
const updatedData = await api
.patch(buildUrl('api/sign-in-exp', { removeUnusedDemoSocialConnector: '1' }), {
json: parser.onboardSieConfigToSignInExperience(formData, signInExperience),
json: payload,
})
.json<SignInExperienceType>();

View file

@ -133,10 +133,14 @@ function SignInExperience() {
setIsSaving(true);
try {
/**
* Note: extract `mfa` since it will not be updated on the SIE config page.
* This is a temporary solution, we will split `SignInExperience` type into multiple types
* when the SIE config page is split into multiple pages.
*/
const { mfa, ...payload } = signInExperienceParser.toRemoteModel(getValues());
const updatedData = await api
.patch('api/sign-in-exp', {
json: signInExperienceParser.toRemoteModel(getValues()),
})
.patch('api/sign-in-exp', { json: payload })
.json<SignInExperienceType>();
reset(signInExperienceParser.toLocalForm(updatedData));
void mutate(updatedData);