I’m currently in the process of migration my apps to the latest Forge version (which has some major changes - a new Node platform and manifest required modifications, remote authorization support et c).
I have existing code from my frontend invoking a function using the resolver, checking authorizations and then performing some work. Simple stuff everyone is doing in their apps I assume, and following the guidelines here: https://developer.atlassian.com/platform/forge/runtime-reference/authorize-api/
Steps are:
- Frontend calls an invoke function with the function name I have registered
- The invoke function does gets called successfully in the new environment (I can see it in the Developer Console). The context input parameter has valid information, including a valid accountId (see the issue below).
- Within the resolver function, calling the authorize() function from @forge/api as per documentation, the code now aborts on:
Error: Couldn’t find the accountId of the invoking user. This API can only be used inside user-invoked modules. at authorize
This worked totally fine before, the documentation still refers to this code snippet just like before. I have also tried to search this forum and other changelog updates from the recent Forge releases and cannot seem to find any deprecation or change related to this (except that Forge now supports external authorization so there could be some major changes made within this component, possibly).
Is there a guideline/recommendation/fix for this, or anyone else that is encountering this issue while migrating to latest Forge? Any advice are very much appreciated, as this is definately a blocker for now!
With kind regards,
Erik