1 parent 2926262 commit c2671cdCopy full SHA for c2671cd
1 file changed
docanalytics-web/src/app/features/security/two-factor-setup.component.ts
@@ -34,12 +34,8 @@ export class TwoFactorSetupComponent {
34
private startSetup(): void {
35
this.auth.setupTwoFactor().subscribe({
36
next: async (res) => {
37
- if (res.error) {
38
- this.error.set(res.error.message);
39
- return;
40
- }
41
if (!res.data) {
42
- this.error.set('Could not start 2FA setup.');
+ this.error.set(res.error?.message ?? 'Could not start 2FA setup.');
43
return;
44
}
45
this.manualKey.set(res.data.manual_key);
@@ -51,6 +47,7 @@ export class TwoFactorSetupComponent {
51
47
});
52
48
53
49
50
+
54
protected confirm(): void {
55
if (this.code().length !== 6) return;
56
this.loading.set(true);
0 commit comments