Implement leave dao and improve login action