My objective is to enable account linking in our application, where users are primarily passwordless authenticated. After installing the extension and modifying the custom domain I tried logging in with a Google account, but it did not work - question regarding this here.
Installing the extension adds a rule, so I opened the real-time logs to inspect the execution - and then I discovered something I did not understand. I have the account link rule placed as the first rule, and several other rules afterwards. But to my big surprise when expecting the real-time webtask logs, I get:
some output from account linking rule as expected
output from the other rules
and then: “Starting Account Link Extension - Version: 2.4.0” after the other rules ended?
So my question is - does the account link rule not await the process, or what is going on here? I would expect the account linking to be done first, and then the execution of the other rules
Each rule is executed as a JavaScript function called in the order defined. The next rule in order won’t execute until the previous rule has completed.
Rule execution supports the asynchronous nature of JavaScript, and constructs such as Promise objects and the like can be used. Asynchronous processing effectively results in suspension of a pipeline pending completion of the asynchronous operation. An Auth0 serverless Webtask container typically has a circa 20-second execution limit, after which the container may be recycled. Recycling of a container due to this limit will prematurely terminate a pipeline—suspended or otherwise—ultimately resulting in an error in authentication being returned (as well as resulting in a potential reset of the global object).
It may depend on the rule and the code you have written.
As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!