Fixed a bug in redirect after login.