refactor: remove debug logs from auth components
Some checks failed
CI / Get Changed Files (pull_request) Successful in 7s
CI / prettier (pull_request) Failing after 23s
CI / eslint (pull_request) Failing after 28s
CI / test-build (pull_request) Successful in 1m16s
CI / Checkstyle Main (pull_request) Successful in 1m22s

This commit is contained in:
Jan K9f 2025-04-02 16:27:35 +02:00
commit 9de08ab233
Signed by: jank
GPG key ID: B9F475106B20F144
3 changed files with 2 additions and 30 deletions

View file

@ -17,30 +17,23 @@ export default class LoginSuccessComponent implements OnInit {
private router: Router = inject(Router);
async ngOnInit() {
console.log('Login success component initialized');
try {
// Handle code flow without throwing errors
const success = await this.oauthService.loadDiscoveryDocumentAndTryLogin();
console.log('Manual login attempt result:', success);
// If we have a valid access token, the user should be loaded in AuthService
const user = this.authService.getUser();
console.log('Login success user:', user);
// Check if we're authenticated
if (this.oauthService.hasValidAccessToken()) {
console.log('Valid access token found');
this.router.navigate(['/home']);
} else {
console.log('No valid access token, waiting for auth service to complete');
// Wait a bit and check if we've been authenticated in the meantime
setTimeout(() => {
if (this.oauthService.hasValidAccessToken() || this.authService.getUser()) {
console.log('Now authenticated, navigating to home');
this.router.navigate(['/home']);
} else {
console.log('Still not authenticated, redirecting to login page');
this.router.navigate(['/']);
}
}, 3000);