Added login function for non-form method