Hi ,
I am trying to create board for unregistered users . But getting “Something went wrong” in the board picker.
The API’s :
async function getTokenFromServer() {
const response = await makeApiRequest(
"POST",
backendApi,
"server/generate/jwt",
false,
{
client_id: "...", // hidden
client_secret: "...", //hidden
}
);
if (response.error) {
console.log(response.message);
return response?.message;
}
console.log("token", response.response.jwt_token);
// this returns a JWT token <string> , there is no errors in this func
return response.response.jwt_token;
}
export const initMiroBoard = () => (dispatch, getState) => {
window.miroBoardsPicker.open({
clientId: "...", // hidden
action: "access-link",
allowCreateAnonymousBoards: true,
getToken: () => getTokenFromServer(),
success: (data) => {
console.log("on success", data);
dispatch(setMiroWhiteboard(data));
},
error: (e) => {
console.log("on error", e);
},
cancel: () => {
console.log("on cancel");
},
});
};
The JWT Response from getTokenFromServer function (JWT is generated and sent to the client as a response , successfully) :
The Error : “Something went wrong” , no other errors or exceptions generated.
Not sure what the issue is , any help is greatly appreciated .
Thanks