mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: handle signup email security update failures
This commit is contained in:
+14
-1
@@ -31,20 +31,29 @@
|
||||
});
|
||||
|
||||
async function updateSignupEmailSecurity() {
|
||||
let currentSubmit = Submit.AuthCanonicalEmailsUpdate;
|
||||
let hasAppliedServerChange = false;
|
||||
|
||||
try {
|
||||
const projectSdk = sdk.forProject(project.region, project.$id).project;
|
||||
|
||||
currentSubmit = Submit.AuthCanonicalEmailsUpdate;
|
||||
await projectSdk.updateCanonicalEmails({
|
||||
enabled: authCanonicalEmails
|
||||
});
|
||||
hasAppliedServerChange = true;
|
||||
|
||||
currentSubmit = Submit.AuthDisposableEmailsUpdate;
|
||||
await projectSdk.updateDisposableEmails({
|
||||
enabled: authDisposableEmails
|
||||
});
|
||||
hasAppliedServerChange = true;
|
||||
|
||||
currentSubmit = Submit.AuthFreeEmailsUpdate;
|
||||
await projectSdk.updateFreeEmails({
|
||||
enabled: authFreeEmails
|
||||
});
|
||||
hasAppliedServerChange = true;
|
||||
|
||||
await invalidate(Dependencies.PROJECT);
|
||||
|
||||
@@ -56,11 +65,15 @@
|
||||
trackEvent(Submit.AuthDisposableEmailsUpdate);
|
||||
trackEvent(Submit.AuthFreeEmailsUpdate);
|
||||
} catch (error) {
|
||||
if (hasAppliedServerChange) {
|
||||
await invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
trackError(error, Submit.AuthCanonicalEmailsUpdate);
|
||||
trackError(error, currentSubmit);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user