Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authGuardPipe seems to be invoked too early in 6.1.0 and 6.1.1 #2681

Closed
theolof opened this issue Nov 23, 2020 · 3 comments
Closed

authGuardPipe seems to be invoked too early in 6.1.0 and 6.1.1 #2681

theolof opened this issue Nov 23, 2020 · 3 comments

Comments

@theolof
Copy link

theolof commented Nov 23, 2020

Version info

Angular: 11.0.0

Firebase: 8.1.1

AngularFire: 6.1.1

How to reproduce these conditions

Steps to set up and reproduce
If I use AngularFire 6.1.0 or later, my authGuardPipe seems to be invoked before the user is fully signed in. claims is empty after signin. If I reload the page, claims is populated. This is also the case if I look at the user object.

const redirectToChangePassword = () => pipe(customClaims, map(claims => {
    console.log(claims);
    return claims.hasSetPassword ?? ['/auth/change-password'];
}));
    {
        path        : 'pages',
        loadChildren: () => import('./main/pages/pages.module').then(m => m.PagesModule),
        canActivate: [AngularFireAuthGuard],
        data: { authGuardPipe: redirectToChangePassword },
        resolve: {
            data: AuthService,
        }
    },

6.1.0-rc.4 works as expected, so something has changed between rc.4 and 6.1.0.

@jamesdaniels
Copy link
Member

Ah yes, there was a share change after rc.4 that could explain this where I was trying to fix a Zone.js issue with analytics. I'll patch.

@jamesdaniels
Copy link
Member

Cutting 6.1.2 this afternoon with a fix.

@theolof
Copy link
Author

theolof commented Nov 25, 2020

Thanks, works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants