File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,6 @@ const getIdToken = async (account, instance) => {
5050 return res . idToken ;
5151 } )
5252 . catch ( ( error ) => {
53- if ( ! ( error instanceof InteractionRequiredAuthError ) ) {
54- console . error ( error ) ;
55- return null ;
56- }
57-
5853 const onSuccess = ( res ) => {
5954 return res . idToken ;
6055 } ;
@@ -64,8 +59,13 @@ const getIdToken = async (account, instance) => {
6459 return null ;
6560 } ;
6661
67- // Failback to popup
68- return instance . acquireTokenPopup ( req ) . then ( onSuccess ) . catch ( onError ) ;
62+ if ( ! ( error instanceof InteractionRequiredAuthError ) ) {
63+ return onError ( error ) ;
64+ }
65+
66+ // Browsers are increasingly blocking third party cookies by default. Detect that option is combersome. Thus, we always use redirect instead of popup.
67+ // See: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3118#issuecomment-1655932572
68+ return instance . acquireTokenRedirect ( req ) . then ( onSuccess ) . catch ( onError ) ;
6969 } ) ;
7070
7171 return idToken ;
You can’t perform that action at this time.
0 commit comments