         if (PortalModel.getInstance().hasSameOrigin(event.credential.server)
             && !PortalModel.getInstance().portal.signedIn)
         {
-            AppEvent.dispatch(AppEvent.PORTAL_SIGN_IN);
+            signIntoPortalInternally();
         }
     }
 

        else
        {
            unloadPortal();
            AppEvent.dispatch(AppEvent.PORTAL_STATUS_UPDATED);
        }
    }


            LOG.info("Portal sign out requested");
        }

        IdentityManager.instance.removeEventListener(IdentityManagerEvent.SIGN_IN, identityManager_signInHandler);
        portal.addEventListener(PortalEvent.LOAD, portal_loadHandler);
        portal.addEventListener(FaultEvent.FAULT, portal_faultHandler);
        portal.signOut();
