I've built an angular app using @angular/pwa
, that supports external logins like Microsoft, Google, Facebook and Twiitter. When a user wants to signin using an external login, I'm using window.open
to open the url hosting the Challenge
.
The problem is that when calling window.open
from the web app in the browser, the url is being forced to open in the PWA.
I've litterally already tried everything I can to prevent this, but without success. The last thing I've tried was to host my endpoints for my external logins on a subdomain, which worked quite well.
But now I've implemented 2FA in my web app, and for 2FA to work, the ExternalLoginSigninAsync
must be called from the same domain as the call to TwoFactorAuthenticatorSignInAsync
. So how can I force an url (window.open) to open in the browser instead of the PWA?
PS: Don't come up with
"navigationUrls": [ "!/web/v3/Account/connect/" ]
)window.open(url, '_system')
window.open(url, '_blank')
window.open(url + '?ngsw-bypass=true')
)That's all been tried, and doesn't work.
This block of code appears to determine whether the PWA should be launched or a new tab should be opened.
Call stack:
false
for the urls you don't want opened in the PWA3 years on.
Done waiting for a W3 draft.
Did it like this
Here's a demo
Note that window.document.location.assign(...)
is not the same as window.location = ...