auth.UserBuilder class

Builder used to create functions for Firebase Auth user lifecycle events.

Signature:

export declare class UserBuilder 

Methods

Method Modifiers Description
beforeCreate(handler) Blocks request to create a Firebase Auth user.
beforeEmail(handler)
beforeSignIn(handler) Blocks request to sign-in a Firebase Auth user.
beforeSms(handler)
onCreate(handler) Responds to the creation of a Firebase Auth user.
onDelete(handler) Responds to the deletion of a Firebase Auth user.

auth.UserBuilder.beforeCreate()

Blocks request to create a Firebase Auth user.

Signature:

beforeCreate(handler: (user: AuthUserRecord, context: AuthEventContext) => MaybeAsync<BeforeCreateResponse | void>): BlockingFunction;

Parameters

Parameter Type Description
handler (user: AuthUserRecord, context: AuthEventContext) => MaybeAsync<BeforeCreateResponse | void> Event handler that blocks creation of a Firebase Auth user.

Returns:

BlockingFunction

auth.UserBuilder.beforeEmail()

Signature:

beforeEmail(handler: (context: AuthEventContext) => MaybeAsync<BeforeEmailResponse | void>): BlockingFunction;

Parameters

Parameter Type Description
handler (context: AuthEventContext) => MaybeAsync<BeforeEmailResponse | void>

Returns:

BlockingFunction

auth.UserBuilder.beforeSignIn()

Blocks request to sign-in a Firebase Auth user.

Signature:

beforeSignIn(handler: (user: AuthUserRecord, context: AuthEventContext) => MaybeAsync<BeforeSignInResponse | void>): BlockingFunction;

Parameters

Parameter Type Description
handler (user: AuthUserRecord, context: AuthEventContext) => MaybeAsync<BeforeSignInResponse | void> Event handler that blocks sign-in of a Firebase Auth user.

Returns:

BlockingFunction

auth.UserBuilder.beforeSms()

Signature:

beforeSms(handler: (context: AuthEventContext) => MaybeAsync<BeforeSmsResponse | void>): BlockingFunction;

Parameters

Parameter Type Description
handler (context: AuthEventContext) => MaybeAsync<BeforeSmsResponse | void>

Returns:

BlockingFunction

auth.UserBuilder.onCreate()

Responds to the creation of a Firebase Auth user.

Signature:

onCreate(handler: (user: UserRecord, context: EventContext) => PromiseLike<any> | any): CloudFunction<UserRecord>;

Parameters

Parameter Type Description
handler (user: UserRecord, context: EventContext) => PromiseLike<any> | any Event handler that responds to the creation of a Firebase Auth user.

Returns:

CloudFunction<UserRecord>

auth.UserBuilder.onDelete()

Responds to the deletion of a Firebase Auth user.

Signature:

onDelete(handler: (user: UserRecord, context: EventContext) => PromiseLike<any> | any): CloudFunction<UserRecord>;

Parameters

Parameter Type Description
handler (user: UserRecord, context: EventContext) => PromiseLike<any> | any Event handler that responds to the deletion of a Firebase Auth user.

Returns:

CloudFunction<UserRecord>