const isOutlookNative = Office.context.mailbox && Office.context.mailbox.diagnostics.hostName === 'Outlook'; | |
if (isOutlookNative) { | |
msal.openPopup = () => { | |
const dummy = { | |
close() { | |
}, | |
location: { | |
assign(url) { | |
Office.context.ui.displayDialogAsync(url, { width: 25 }, res => { | |
dummy.close = res.value.close; | |
res.value.addEventHandler(Office.EventType.DialogMessageReceived, ({ message }) => | |
dummy.location.href = dummy.location.hash = message | |
); | |
}); | |
} | |
} | |
}; | |
return dummy; | |
}; | |
const { hash } = window.location; | |
if (msal.isCallback(hash)) { | |
Office.context.ui.messageParent(hash); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment