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:
parent
17fd64e643
commit
2a64e7f32d
2 changed files with 18 additions and 4 deletions
|
@ -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>();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue