File tree Expand file tree Collapse file tree
apps/main-dashboard/src/app/modules/auth/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { HttpClient } from '@angular/common/http' ;
22import { inject , Injectable , forwardRef } from '@angular/core' ;
3+ import { Router } from '@angular/router' ;
34import { TokenService } from '../../../shared/services/token.service' ;
45import { CookieService } from '../../../shared/services/cookie.service' ;
56import {
@@ -22,6 +23,7 @@ import { environment } from '../../../../environments/environment';
2223} )
2324export class AuthService {
2425 private auth = inject ( Auth ) ;
26+ private router = inject ( Router ) ;
2527 user$ : Observable < User | null > ;
2628 private http = inject ( HttpClient ) ;
2729 private tokenService = inject ( forwardRef ( ( ) => TokenService ) ) ;
@@ -50,7 +52,11 @@ export class AuthService {
5052 try {
5153 const result = await getRedirectResult ( this . auth ) ;
5254 if ( result ?. user ) {
55+ console . log ( 'Utilisateur authentifié via redirect, traitement du login...' ) ;
5356 await this . postLogin ( result . user ) ;
57+ // Rediriger vers le dashboard après une authentification réussie
58+ console . log ( 'Navigation vers /console après authentification mobile réussie' ) ;
59+ await this . router . navigate ( [ '/console' ] ) ;
5460 }
5561 } catch ( error ) {
5662 console . error ( 'Erreur lors de la gestion du résultat de redirection:' , error ) ;
You can’t perform that action at this time.
0 commit comments