abstract login-put check from test1 to login