Can anyone help me with this as I can’t see what might be wrong?!
The code is a website, currently on Test19 at safe://myfd.rsports. After loading, click the blue SAFE icon (top right).
At the call to safeApp.connectAuthroised() I get an error:
Error: Unexpected (probably a logic error): Could not connect to the SAFE Network
The authUri I have seems very long (several full screen width lines), so I wonder if there’s a problem with that but as the error happens afterwards it is probably ok.
Here is a code fragment, but if you load safe://myfd.rsports you can debug it directly:
window.safeApp.initialise(self.appKeys).then((appHandle) => {
RS.log('SAFEApp instance initialised and appHandle returned: ', appHandle);
window.safeApp.authorise(appHandle, self.appKeys.permissions, self.appKeys.options)
.then((authUri) => {
RS.log('SAFEApp was authorised and authUri received: ', authUri);
window.safeApp.connectAuthorised(appHandle, authUri)
.then(_ => {
RS.log('SAFEApp was authorised & a session was created with the SafeNetwork');
self.configure({
appHandle: appHandle, // safeApp.initialise() return (appHandle)
authURI: authUri, // safeApp.authorise() return (authUri)
permissions: self.appKeys.permissions, // Permissions used to request authorisation
options: self.appKeys.options, // Options used to request authorisation
});
}, function (err){
self.reflectNetworkStatus(false);
RS.log('SAFEApp SafeNetwork Connect Failed: ' + err);
});
}, function (err){
self.reflectNetworkStatus(false);
RS.log('SAFEApp SafeNetwork Authorisation Failed: ' + err);
});
}, function (err){
self.reflectNetworkStatus(false);
RS.log('SAFEApp SafeNetwork Initialise Failed: ' + err);
});