diff --git a/scripts/actions/src/manage-scopes.ts b/scripts/actions/src/manage-scopes.ts index 5a707f2..19f1ac5 100644 --- a/scripts/actions/src/manage-scopes.ts +++ b/scripts/actions/src/manage-scopes.ts @@ -61,7 +61,7 @@ exports.onExecutePostLogin = async ( } const userId = event.user.user_id - const clientId = event.client.clientId + const clientId = event.client.client_id // Whitelist of applications that can access the full set of scopes const allowAllScopesWhitelist: string[] = diff --git a/scripts/actions/types/auth0-actions.d.ts b/scripts/actions/types/auth0-actions.d.ts index 0694a73..8de3fe4 100644 --- a/scripts/actions/types/auth0-actions.d.ts +++ b/scripts/actions/types/auth0-actions.d.ts @@ -9,12 +9,17 @@ export interface ActionsDefaultSecrets { // auth0-actions doesn't have all the types completely correct, use the modified types below. // TODO upgrade to an officially supported type package once one becomes available +// `client_id` is incorrectly typed as `clientId` (see https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object) +interface CorrectlyTypedClient extends Omit, 'clientId'> { + client_id: string +} + export interface DefaultPostLoginEvent extends PostLoginEvent { secrets: ActionsDefaultSecrets // `user` and `client` are not optional according to https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object user: UserBase - client: Client + client: CorrectlyTypedClient } export interface DefaultPostLoginApi extends PostLoginApi {