Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Auth Guard - BUG] canActivate auth guard causes blank screen after cache clear with multiple tabs opens.

Aperta
#3,691 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
angular, firebase, typescript

Direzione di ricerca

Inizia con la configurazione minima dell’autenticazione AngularFire descritta nell’issue, usando il guard canActivate con redirectLoggedInTo e redirectUnauthorizedTo. Riproduci il comportamento con due schede, svuota la cache in una di esse e aggiornala. È completato quando la scheda aggiornata viene caricata normalmente invece di mostrare una schermata vuota mentre l’altra scheda rimane aperta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

If using the canActivate auth guard (with spread syntax), If you have more than 1 tab open of the same app, and then you clear the cache by using the browser in one of the tabs, and try to refresh, it causes a blank screen, which resolves after you close the other open tab.

steps to reproduce:

versions:
"@angular/common": "^20.3.0",
"@angular/compiler": "^20.3.0",
"@angular/core": "^20.3.0",
"@angular/fire": "^20.0.1",
"@angular/forms": "^20.3.0",
"@angular/platform-browser": "^20.3.0",
"@angular/router": "^20.3.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"

steps to reproduce:

  1. Create new project
  2. install angular fire
  3. setup authentication and firebase project
  4. utilize the ...canActivate auth guard like below.
  5. open two tabs of the same page.
  6. in one of them, clear the cache (by using the button close to the url in chrome for ex)
  7. refresh
  8. blank screen.
  9. verify that if you close the second tab, then the first one loads correctly.
const redirectTeste1 = () => redirectLoggedInTo('test2');
const redirectTeste2 = () => redirectUnauthorizedTo('teste1');

export const routes: Routes = [
  { path: '', redirectTo: 'teste1', pathMatch: 'full' },

  {
    path: 'teste1',
    component: Test1,
    ...canActivate(redirectTeste1),
  },

  {
    path: 'teste2',
    component: Test2,
    ...canActivate(redirectTeste2),
  },
];

lmk if this is somehow a user error, but with such a barebones configuration I think is a legitimate bug.

Lingua principale
TypeScript
Stelle
7.8k
Fork
2.2k
Merge medio
3g 6h
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/angularfire

Tutte le issue di angular/angularfire

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.