| import { Component } from '@angular/core'; | |
| import { AuthService } from './auth/auth.service'; | |
| ({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrl: './app.component.css' | |
| }) | |
| export class AppComponent { | |
| constructor(private authService: AuthService) { } | |
| title = 'Py-Learn'; | |
| ngOnInit(): void { | |
| this.authService.checkSession().subscribe((status) => { | |
| if (status) { | |
| this.authService.startAutoRefresh(); // ✅ Start auto-refresh once app loads and session is valid | |
| } | |
| }); | |
| } | |
| } | |