Post-Login Trigger Only Firing for One Application in my Tenant - Why Not The Others?

I have a custom action set up in a tenant as a post-login trigger. Basically, it is reaching out to a legacy internal API and tacking some necessary custom metadata onto auth0 tokens via api.idToken.setCustomClaim() before returning them to my NextJS UIs. It works great on one of my applications, but I have several applications in this tenant and the trigger is not firing for any of the others.

I’ve looked through the settings and configurations on all of these applications and can’t seem to identify the difference that makes the custom trigger work post-login on the one and not on any of the others. Any idea why this is happening?

Hi @relero90

Welcome back to the Auth0 Community!

I’ve checked the tenant logs, and it looks like the actions were successfully triggered for login to separate applications. There’s no setting in Auth0 that would, in a plug-and-play fashion, specify for which application your action will trigger. You can check the Action Executions by adding console.logs in the action code and checking Logs → Clicking on the Success Login event and switching the tab to Actions Executions.

Thanks
Dawid

Thank you Dawid,

I can see that you’re right - the actions are triggering consistently across all apps in this tenant. In digging deeper, it seems the failure to return a user id token with this custom metadata attached is due to some problem in the beta v4 auth0 NextJS SDK.

My app that has the metadata successfully returned is running NextJS 14 with the auth0 v3 SDK and the other apps that are not receiving the metadata are running NextJS 15 with the auth0 beta v4 SDK. I have confirmed this is the cause by doing a quick refactor on one of my Next 15 apps to use the old SDK and it does subsequently return the custom metadata with the User object.

Is someone aware of this problem / a resolution for it? My Next 15 apps need that beta v4 SDK because the v3 SDK cannot access the auth0 session on the server side. They also need to receive this custom metadata. Any help would be greatly appreciated.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.