front-end work for log-in