solved: it was not the getAccessToken that was hanging.
we removed the async from the onMessageComposeHandler and replaced the await OfficeRuntime.auth.getAccessToken by OfficeRuntime.auth.getAccessToken.then() and it started working flawless again
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We have an Outlook web-addin that has the onMessageComposeHandler associated in the manifest.
A couple of times a day the addin hangs while retrieving an accesstoken. It does not crash, but it just hangs, so we are not able to redirect the user to login or something else.
Most of the day it works. We experienced this sometimes while developing, but now our client is also experiencing this.
Here is a piece of the code:
async function onMessageComposeHandler(event) {
mailboxItem = Office.context.mailbox.item;
try {
log("Loading user...");
const accessToken = await OfficeRuntime.auth.getAccessToken({forceConsent: false})
solved: it was not the getAccessToken that was hanging.
we removed the async from the onMessageComposeHandler and replaced the await OfficeRuntime.auth.getAccessToken by OfficeRuntime.auth.getAccessToken.then() and it started working flawless again