Skip to content

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

Closed

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 ?? ['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/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.

Activity

  1. jamesdaniels commented on Nov 23, 2020

    @jamesdaniels
    Contributor

    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.

  2. jamesdaniels commented on Nov 24, 2020

    @jamesdaniels
    Contributor

    Cutting 6.1.2 this afternoon with a fix.

  3. theolof commented on Nov 25, 2020

    @theolof
    Author

    Thanks, works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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