A new … Help! I’m updating my node app (SAFE Drive) from safe-node-app 0.8.1 to 0.10.x
I’ve simplified the auth genAuthUri() parameters to match the example in the docs (except I have options = {own_container: false} and the Auth URI I created matches the one shown in the debug output, but Authenticate.js is complaining about something here:
I’ve checked the parameters passed to genAuthUri() several times, so pretty sure they are ok. What else could cause the above error?
I see the error is in SAFE Browser, which looks like the failure is inside this.safeLib.auth_decode_ipc_msg(), which fails in one of its callbacks here:
Most likely you are working with mock-routing and expecting your auth request to be generated for mock routing, which requires a mock bit, but are actually generating a request for live network.
Either the application needs to be executed with NODE_ENV=test environment variable, or forceUseMock: true passed to initialisation options, or app executed with --mock flag.
I confused myself over this yesterday actually. Going to review to make sure this is clear in documentation.
Thanks Hunter, I hadn’t noticed the change from NODE_ENV=dev to NODE_ENV=test, using the latter now works although I am not getting much further!
I now get to handling the auth response in my app, but then exit. I need to look into that though.
I have noticed something else, which might be intentional or a bug. I am using SB 11.1 (just released) and if I have the authenticator padlock open (ie automatically authorise apps) I never get the auth popup even if I have revoked auth. Is that expected (e.g. with dev build of browser --debug)?
I do get the popup with the authenticator padlock closed.
UPDATE: Sorted! I missed the change from fromAuthURI() to fromAuthUri().
Thanks for the fast responses @hunterlester , they are really appreciated.
NODE_ENV=dev is for downloading both the mock and non-mock libs but mock libs won’t be used unless one of the three aforementioned options is used to actually load them.