Skip to content

Regression: FirebaseAuthState is missing expires field #815

@KLiFF2606

Description

@KLiFF2606

Hi,

'expires' does not seem to be populated any more since release 2.0.0-beta.1.

I'm currently using the last release (2.0.0-beta.7) and when I log this field to the console it shows 'undefined'.

Here is my packages configuration
@angular/core: ^2.3.1
angularfire2: ^2.0.0-beta.7

And my code:

this.af.auth.subscribe(authState => {
    if(auth != null) {
        console.log('Expiration time', authState.expires);
    } else {
        console.log('User not authenticated!');
    }
});

I use Google as a provider and have this as the onClick action for a button:
this.af.auth.login();

I took a look to release 2.0.0-beta.0 and 2.0.0-beta.1 and this line is missing from this latter:
file : angularfire2/src/providers/auth_backend.ts
class: AuthBackend
method: authDataToAuthState
81: let authState: FirebaseAuthState = { auth, uid, expires: authData.expires, provider: null };
was changed to:
73: let authState: FirebaseAuthState = { auth: authData, uid, provider: null };

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