mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-13 09:25:12 +00:00
fix(api): add remove otp sms and email to management api (#6721)
* fix(api): add remove otp sms and email to management api * fix(console): remove otpsms and otpemail from user --------- Co-authored-by: peintnermax <[email protected]>
This commit is contained in:
co-authored by
peintnermax
parent
ce719a3fa4
commit
cb0a0f996e
+2
-2
@@ -157,7 +157,7 @@ export class AuthUserMfaComponent implements OnInit, OnDestroy {
|
||||
this.service
|
||||
.removeMyAuthFactorOTPEmail()
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.U2FREMOVED', true);
|
||||
this.toast.showInfo('USER.TOAST.OTPREMOVED', true);
|
||||
|
||||
this.cleanupList();
|
||||
this.getMFAs();
|
||||
@@ -169,7 +169,7 @@ export class AuthUserMfaComponent implements OnInit, OnDestroy {
|
||||
this.service
|
||||
.removeMyAuthFactorOTPSMS()
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.U2FREMOVED', true);
|
||||
this.toast.showInfo('USER.TOAST.OTPREMOVED', true);
|
||||
|
||||
this.cleanupList();
|
||||
this.getMFAs();
|
||||
|
||||
@@ -102,6 +102,36 @@ export class UserMfaComponent implements OnInit, OnDestroy {
|
||||
.catch((error) => {
|
||||
this.toast.showError(error);
|
||||
});
|
||||
} else if (factor.otpEmail) {
|
||||
this.mgmtUserService
|
||||
.removeHumanAuthFactorOTPEmail(this.user.id)
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.OTPREMOVED', true);
|
||||
|
||||
const index = this.dataSource.data.findIndex((mfa) => !!mfa.otpEmail);
|
||||
if (index > -1) {
|
||||
this.dataSource.data.splice(index, 1);
|
||||
}
|
||||
this.getMFAs();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toast.showError(error);
|
||||
});
|
||||
} else if (factor.otpSms) {
|
||||
this.mgmtUserService
|
||||
.removeHumanAuthFactorOTPSMS(this.user.id)
|
||||
.then(() => {
|
||||
this.toast.showInfo('USER.TOAST.OTPREMOVED', true);
|
||||
|
||||
const index = this.dataSource.data.findIndex((mfa) => !!mfa.otpSms);
|
||||
if (index > -1) {
|
||||
this.dataSource.data.splice(index, 1);
|
||||
}
|
||||
this.getMFAs();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toast.showError(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user