Refactor logging in LoginController, simplify auth.service token validation, and remove debug logs from AppealComponent.

This commit is contained in:
2025-08-05 23:22:12 +02:00
parent bdb38e5011
commit f67cb50f41
3 changed files with 18 additions and 18 deletions
@@ -164,9 +164,7 @@ export class AppealComponent implements OnInit, AfterViewInit {
public nextPage() {
if (this.currentPageIndex === this.totalPages.length - 1) {
console.log('Adding page');
this.totalPages.push(this.currentPageIndex + 1);
console.log(this.totalPages);
}
this.goToPage(this.currentPageIndex + 1);
}
+15 -15
View File
@@ -72,23 +72,23 @@ export class AuthService {
*/
public checkAuthStatus(): boolean {
const jwt = this.getJwt();
if (jwt) {
try {
// Check if token is expired
if (this.jwtHelper.isTokenExpired(jwt)) {
this.logout();
return false;
}
const claims = this.extractJwtClaims(jwt);
console.log("User claims: ", claims);
this.userClaimsSubject.next(claims);
this.isAuthenticatedSubject.next(true);
this.reloadUsername();
return true;
} catch (e) {
if (!jwt) {
return false;
}
try {
if (this.jwtHelper.isTokenExpired(jwt)) {
this.logout();
return false;
}
const claims = this.extractJwtClaims(jwt);
console.log("User claims: ", claims);
this.userClaimsSubject.next(claims);
this.isAuthenticatedSubject.next(true);
this.reloadUsername();
return true;
} catch (e) {
this.logout();
}
return false;
}