login functionality on client side