Fix redirect when auto-login