builds out login-check logic.