// src/app/google-callback/google-callback.component.ts import { Component, OnInit } from '@angular/core'; import { AuthService } from '../auth.service'; import { Router, ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-google-callback', template: '
Loading...
', styles: [] }) export class GoogleCallbackComponent implements OnInit { constructor( private authService: AuthService, private router: Router, private route: ActivatedRoute ) {} ngOnInit(): void { this.route.queryParams.subscribe(params => { console.log("callback-hit"); const token = params['token']; if (token) { localStorage.setItem('token', token); this.router.navigate(['/']); } else { this.router.navigate(['/login']); } }); } }