Skip to content

Commit d874dca

Browse files
committed
fix(generic-filter): add max-height and overflow for filter value field container
1 parent c374e27 commit d874dca

3 files changed

Lines changed: 24 additions & 15 deletions

File tree

frontend/src/app/core/auth/auth-jwt.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export class AuthServerProvider {
4545
{observe: 'response'}).pipe(map(authenticateSuccess.bind(this)));
4646
}
4747

48+
renewCode(): Observable<any> {
49+
return this.http.get(SERVER_API_URL + 'api/tfa/generate-challenge');
50+
}
51+
4852
verifyCode(code): Observable<any> {
4953
const authenticateSuccess = (resp) => {
5054
this.storeAuthenticationToken(resp.body.id_token);

frontend/src/app/shared/components/auth/totp/totp.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ <h4 class="fw-semibold mb-2 text-dark">Two-Factor Authentication</h4>
4848
</div>
4949
</div>
5050

51-
<!-- Countdown Timer -->
52-
<div class="text-center mb-4">
51+
<!--&lt;!&ndash; Countdown Timer &ndash;&gt;
52+
<div [hidden]="true" class="text-center mb-4">
5353
<div class="text-center mb-4">
5454
<div class="timer-display d-inline-block px-4 py-2 rounded"
5555
style="background-color: #f8f9fa; border: 1px solid #e9ecef; font-family: 'Courier New', monospace;">
@@ -61,7 +61,7 @@ <h4 class="fw-semibold mb-2 text-dark">Two-Factor Authentication</h4>
6161
</app-countdown>
6262
</div>
6363
</div>
64-
</div>
64+
</div>-->
6565

6666
<!-- Verification Form -->
6767
<form (ngSubmit)="onSubmit()" #verifyForm="ngForm" novalidate>

frontend/src/app/shared/components/auth/totp/totp.component.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1-
import {Component, OnInit} from '@angular/core';
1+
import {Component, OnDestroy, OnInit} from '@angular/core';
22
import {DomSanitizer} from '@angular/platform-browser';
33
import {Router} from '@angular/router';
44
import {NgxSpinnerService} from 'ngx-spinner';
5-
import {Observable} from 'rxjs';
5+
import {interval, Observable, Subscription} from 'rxjs';
6+
import {AccountService} from '../../../../core/auth/account.service';
67
import {AuthServerProvider} from '../../../../core/auth/auth-jwt.service';
8+
import {StateStorageService} from '../../../../core/auth/state-storage.service';
9+
import {UtmToastService} from '../../../alert/utm-toast.service';
710
import {ThemeChangeBehavior} from '../../../behaviors/theme-change.behavior';
11+
import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE} from '../../../constants/global.constant';
812
import {TfaMethod} from '../../../services/tfa/tfa.service';
9-
import {extractQueryParamsForNavigation} from "../../../util/query-params-to-filter.util";
10-
import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE} from "../../../constants/global.constant";
11-
import {StateStorageService} from "../../../../core/auth/state-storage.service";
12-
import {AccountService} from "../../../../core/auth/account.service";
13-
import {UtmToastService} from "../../../alert/utm-toast.service";
13+
import {extractQueryParamsForNavigation} from '../../../util/query-params-to-filter.util';
1414

1515

1616
@Component({
1717
selector: 'app-totp',
1818
templateUrl: './totp.component.html',
1919
styleUrls: ['./totp.component.scss']
2020
})
21-
export class TotpComponent implements OnInit {
21+
export class TotpComponent implements OnInit, OnDestroy {
2222
form: any = {};
23-
isLoggedIn = false;
24-
isLoginFailed = false;
2523
errorMessage = '';
26-
currentUser: any;
2724
isVerifying = false;
2825
loginImage$: Observable<string>;
2926
TfaMethod = TfaMethod;
3027
method: TfaMethod;
3128
isVerified = false;
3229
verificationCode = '';
30+
private expireSub: Subscription;
3331

3432
constructor(private authService: AuthServerProvider,
3533
private router: Router,
@@ -44,6 +42,8 @@ export class TotpComponent implements OnInit {
4442
ngOnInit(): void {
4543
this.method = this.authService.tfaMethod;
4644
this.loginImage$ = this.themeChangeBehavior.$themeIcon.asObservable();
45+
46+
this.expireSub = interval(30 * 1000).subscribe(() => this.onExpire());
4747
}
4848

4949

@@ -66,7 +66,8 @@ export class TotpComponent implements OnInit {
6666
}
6767

6868
onExpire() {
69-
69+
console.log('expired');
70+
this.authService.renewCode().subscribe();
7071
}
7172

7273
clearError() {
@@ -94,4 +95,8 @@ export class TotpComponent implements OnInit {
9495
}
9596
});
9697
}
98+
99+
ngOnDestroy() {
100+
this.expireSub.unsubscribe();
101+
}
97102
}

0 commit comments

Comments
 (0)