This must be a bug in the current version of firebase, so what solved the problem for me is simply replace signInWithRedirect() with signInWithPopup()
signInWithRedirect()
signInWithPopup()