Better way of register login

Without depend on the result