Skip to content

Commit eb622de

Browse files
addressing review feedback
1 parent 4f80659 commit eb622de

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/v2/providers/identity.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@ export type User = AdminUserRecord;
383383
*/
384384
export interface AuthEvent<T> extends CloudEvent<T> {
385385
/** The project identifier*/
386-
project: string;
387-
/** The ID of the Identity Platform Tenant Assosciated with the event. If Applicable */
388-
tenantId: string;
386+
project?: string;
387+
/** The ID of the Identity Platform Tenant Associated with the event. If Applicable */
388+
tenantId?: string;
389389
}
390390

391391
/** Options for configuring a Firebase Authentication Trigger */
@@ -422,7 +422,11 @@ function makeAuthTrigger(
422422
const { opts, handler: handlerFunc } = getOptsAndHandler(optsOrHandler, handler);
423423

424424
const func = ((raw: CloudEvent<unknown>) => {
425-
const event = raw as AuthEvent<User>;
425+
const event: AuthEvent<User> = {
426+
...raw,
427+
project: undefined,
428+
tenantId: undefined,
429+
} as AuthEvent<User>;
426430
const rawAny = raw as any;
427431
if (rawAny.tenantid) {
428432
event.tenantId = rawAny.tenantid;
@@ -455,7 +459,7 @@ function makeAuthTrigger(
455459
region: "global",
456460
},
457461
};
458-
if (opts.tenantId) {
462+
if (opts.tenantId !== undefined) {
459463
if (opts.tenantId === IS_NOT_TENANT) {
460464
endpoint.eventTrigger.eventFilters["tenantid"] = "";
461465
} else {

0 commit comments

Comments
 (0)