fix a bug of local login and added a redirect page