refactor: remove debug logs from auth components
Some checks failed
Some checks failed
This commit is contained in:
parent
2e76446328
commit
9de08ab233
3 changed files with 2 additions and 30 deletions
|
@ -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);
|
||||
|
|
Reference in a new issue