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.
beforeSignIn(handler) Blocks request to sign-in a Firebase Auth user.
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) => BeforeCreateResponse | void | Promise<BeforeCreateResponse> | Promise<void>): BlockingFunction;

Parameters

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

Returns:

BlockingFunction

auth.UserBuilder.beforeSignIn()

Blocks request to sign-in a Firebase Auth user.

Signature:

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

Parameters

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

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>