Skip to content

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

Closed
@theolof

Description

@theolof

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions