Following the example app, I am trying to set up Forge Remote with a hosted server. However, before any request hits the server, I am getting this error:
Error: Remote could not verify the Forge Invocation Token
I combed through the stack trace and it seems it fails in the getCallBridge
function of @forge/bridge but I can’t figure out why.
Here is the code:
import React, {useEffect, useState} from 'react';
import ForgeReconciler, { Inline } from '@forge/react';
import { invokeRemote } from '@forge/bridge';
const App = () => {
const [data, setData] = useState<any>(null);
useEffect(() => {
invokeRemote({
method: 'POST',
path: '/test'
}).then(res => {
console.log("RESPONSE")
setData(res);
})
}, []);
if (data) {
const res = data.body;
return (
<>
<Inline> Remote results:</Inline>
<Inline> {res.test ? 'Test success!' : 'Test fail :('}</Inline>
</>
);
}
return (
<Inline>Performing Remote Invocation...</Inline>
)
};
ForgeReconciler.render(
<App />
);