auth0 / auth0-spa-js

Auth0 authentication for Single Page Applications (SPA) with PKCE
MIT License
909 stars 360 forks source link

feat: Improve popup open error #1292

Open ArthurKnoep opened 1 month ago

ArthurKnoep commented 1 month ago

Changes

This PR introduces a new error class for the getTokenWithPopup method: PopupOpenError. This error will be thrown if the method is unable to open the popup (most likely because it has been blocked by the browser).

Having a specific error class makes it much easier to catch the error and do specific error handling (such as explaining to the users how to allow popups on their browser)

This PR should be retro-compatible with all developpers running a string comparison with the error message to detect popup permission issues as it uses the same error message.

References

Testing

Checklist