Skip to content

Instantly share code, notes, and snippets.

View adagala's full-sized avatar
🏠
Working from home

Henry Adagala adagala

🏠
Working from home
View GitHub Profile
@adagala
adagala / auth.guard.ts
Created September 25, 2021 15:45
Angular Firebase Router Guard with Browser Refresh
import { Injectable } from '@angular/core';
import { Auth, authState } from '@angular/fire/auth';
import { CanActivate, Router, UrlTree } from '@angular/router';
import { map, Observable, take, tap } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate {