much better login process (without popup)