Put Tk/Terminal login logic into appropriate locations within the login logic.