I am having challenges redirecting once a user has signed in. It's working

I am having challenges redirecting once a user has signed in. It’s working perfectly in localhost and local ip address after appending the xip.io suffix to the ip address (to mimick the behaviour in a domain environment) but fails(doesn’t redirect or fire UserLoginEvents) when I test in my organization’s domain. It just displays the sign out label.

The corporate domain has been added to the list of Authorised Javascript origins, Authorised Redirect URI and AUthorisedDomains

The following is my code snippet as per above:

WrappedSession session=(WrappedSession) UI.getCurrent().getSession().getSession(); //to create session variables on the current user

GoogleSignin signIn=new GoogleSignin(“MY CLIENT ID”);

   signIn.setBrand(Brand.GOOGLE);
   signIn.setLabelSignin("Sign in via your Email");
   signIn.setWidth(Width.WIDE);
   signIn.setTheme(Theme.DARK);
   signIn.setHeight(Height.STANDARD);
   signIn.setAutoLogout(false);
   signIn.setLabelSignout("Email Detected - Sign Out");
                        
   signIn.addLoginListener(new Consumer<UserLoginEvent>() {
	
	@Override
	public void accept(UserLoginEvent t) {
		try
		{
			Notification.show("Name: "+t.getName(), 5000, Notification.Position.BOTTOM_END);
		    Notification.show("Email: "+t.getEmail(), 5000, Notification.Position.BOTTOM_END);
		    session.setAttribute("name", t.getName());
			session.setAttribute("email", t.getEmail());
			UI.getCurrent().navigate("home");

}
catch(Exception error)
{
Notification.show("An error occurred "+error.toString(),5000,Notification.Position.BOTTOM_END);
}

	}
	
	Your support will be highly appreciated.