(feat) add login logic for client side