Skip to content

existing user modification time and new user signup timestamps are same #1209

Closed
@j2emanue

Description

@j2emanue

It seems the check to verify if the user is a new SignUp or existing user is not working.

I signed up a user brand new and then logged out of email provider.

I then logged in again (and got the welcome back screen) and signed in again.

I did this immediately with about 10 seconds delay between:

but the following code always returns true:

  public boolean isNewSignUp() {
       FirebaseUserMetadata metadata = mAuth.getCurrentUser().getMetadata();
       if (metadata.getCreationTimestamp() == metadata.getLastSignInTimestamp()) {
           Toast.makeText(getActivity(), "new user ACCOUNT CREATED", Toast.LENGTH_LONG).show();
       } else {
           // This is an existing user, show them a welcome back screen.

           Toast.makeText(getActivity(), "existing user account retrieved", Toast.LENGTH_LONG).show();
       }

       return metadata.getCreationTimestamp() == metadata.getLastSignInTimestamp();
   }

i am using fireBaseUI-Auth and this check happens in onActivityResult. What am i missing ?

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