I have a web app that will pop up an Apple Music authorization window when the following code is run:
const handleAppleMusicAuthorize = async () => {
try {
await window.MusicKit.getInstance().authorize();
// do stuff
} catch (error) {
console.warn("Error authorizing apple music", error);
}
};
If the user successfully authorizes the app, all is good; however, if the user closes the pop-up or cancels the process, there is no feedback for the app to detect.
I was thinking of using a timeout, but that seems ineligant.
What's the best way to handle this?
Any advice would be appreciated.