Interface default

A user account.

Hierarchy

  • UserInfo
    • default

Properties

displayName: string

The display name of the user.

email: string

The email of the user.

emailVerified: boolean

Whether the email has been verified with sendEmailVerification and applyActionCode.

isAnonymous: boolean

Whether the user is authenticated using the ProviderId.ANONYMOUS provider.

metadata: UserMetadata

Additional metadata around user creation and sign-in times.

phoneNumber: string

The phone number normalized based on the E.164 standard (e.g. +16505550101) for the user.

Remarks

This is null if the user has no phone credential linked to the account.

photoURL: string

The profile photo URL of the user.

providerData: UserInfo[]

Additional per provider such as displayName and profile information.

providerId: string

The provider used to authenticate the user.

refreshToken: string

Refresh token used to reauthenticate the user. Avoid using this directly and prefer getIdToken to refresh the ID token instead.

tenantId: string

The user's tenant ID.

Remarks

This is a read-only property, which indicates the tenant ID used to sign in the user. This is null if the user is signed in from the parent project.

Example

// Set the tenant ID on Auth instance.
auth.tenantId = 'TENANT_PROJECT_ID';

// All future sign-in request now include tenant ID.
const result = await signInWithEmailAndPassword(auth, email, password);
// result.user.tenantId should be 'TENANT_PROJECT_ID'.
uid: string

The user's unique ID, scoped to the project.

Methods

  • Deletes and signs out the user.

    Remarks

    Important: this is a security-sensitive operation that requires the user to have recently signed in. If this requirement isn't met, ask the user to authenticate again and then call one of the reauthentication methods like reauthenticateWithCredential.

    Returns Promise<void>

  • Returns a JSON Web Token (JWT) used to identify the user to a Firebase service.

    Remarks

    Returns the current token if it has not expired or if it will not expire in the next five minutes. Otherwise, this will refresh the token and return a new one.

    Parameters

    • Optional forceRefresh: boolean

      Force refresh regardless of token expiration.

    Returns Promise<string>

  • Returns a deserialized JSON Web Token (JWT) used to identify the user to a Firebase service.

    Remarks

    Returns the current token if it has not expired or if it will not expire in the next five minutes. Otherwise, this will refresh the token and return a new one.

    Parameters

    • Optional forceRefresh: boolean

      Force refresh regardless of token expiration.

    Returns Promise<IdTokenResult>

  • Refreshes the user, if signed in.

    Returns Promise<void>

  • Returns a JSON-serializable representation of this object.

    Returns object

    A JSON-serializable representation of this object.

Generated using TypeDoc