I’m trying to get the current user in a Compass Forge app (compass-component-page).
In the src/component-page.js i try the following:
resolver.define("syncUser", async (req, res) => {
const query = `query { user(accountId:"${req.context.accountId}") { accountId, name } }`;
const userResponse = await api.asApp().requestGraph(query, {}, {} );
const user = await userResponse.json();
...
}
But I get “This request does not contain the right authorisation scopes to provide a value for this field”.
I can’t find the correct scope to add. Like for Jira for example, I add read:jira-user.
What am I missing here?
Thanks.
Magnus