AngularFire2 authentication with CanActivate not working
<p>Angular 2 RC6 using AngularFire2.  My authentication works which causes a redirect to a guarded route ("/feed").  When the canActivate method in the AuthGuard fires, authentication is always null.  It seems as if authentication happens before the guard is ever constructed, so the subscribe in the guard does nothing.</p>

<p>login.ts (this authentication works and redirects to 'feed')</p>

<pre><code>constructor(public af: AngularFire, private router: Router) {
  this.af.auth.subscribe(auth =&gt; console.log(auth));
}
login() {
  this.af.auth.login({
    provider: AuthProviders.Facebook,
    method: AuthMethods.Popup,
  }).then((x: FirebaseAuthState) =&gt; {
    console.log(x);
    this.router.navigate(['/feed']);
  }).catch(x =&gt; console.log(x));
}
</code></pre>

<p>feed.routes.ts</p>

<pre><code>export const feedRoutes: Routes = [
  {
    path: '',
    component: FeedComponent,
    canActivate: [AuthGuard]
  }
];
</code></pre>

<p>auth-guard.service.ts</p>

<pre><code>import { Injectable }             from '@angular/core';
import { CanActivate, Router,
        ActivatedRouteSnapshot,
        RouterStateSnapshot }    from '@angular/router';
import { AngularFire, AngularFireAuth, FirebaseAuthState }            from 'angularfire2';
import { Observable } from 'rxjs';

@Injectable()
export class AuthGuard implements CanActivate {
  auth: FirebaseAuthState;

  constructor(private af: AngularFire, private router: Router) {
    console.log('auth guard constructed');
    this.af.auth.subscribe(authState =&gt; console.log(authState));
    this.af.auth.subscribe(x =&gt; this.auth = x);
  }

  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
    console.log('can activate ' + this.auth)
    if (this.auth == null){
      // this part always fires
      console.log('no auth!')
      this.router.navigate(['/login']);
      return false;
    } 
      console.log('authenticated');
    return true;
  }
}
</code></pre>

<p>Here is what is printed to the console:</p>

<pre><code>Object {auth: W, uid: "xYFs8kMDpKdYKxDw4AL21FtnSWn1", provider: 2, facebook: Of}
auth-guard.service.ts:13 auth guard constructed
auth-guard.service.ts:19 can activate undefined
auth-guard.service.ts:21 no auth!
</code></pre>

<p>Notice the actions in the .subscribe never occur.</p>