core-api: if loginPopup is rejected, throw PopupRejectedError

This commit is contained in:
Patrik Oldsberg
2021-01-28 19:02:32 +01:00
parent 8b57797896
commit e1e650e12a
+3 -1
View File
@@ -82,7 +82,9 @@ export function showLoginPopup(options: LoginPopupOptions): Promise<any> {
let targetOrigin = '';
if (!popup || typeof popup.closed === 'undefined' || popup.closed) {
reject(new Error('Failed to open auth popup.'));
const error = new Error('Failed to open auth popup.');
error.name = 'PopupRejectedError';
reject(error);
return;
}