auto-login & redirect method