def METHOD_NAME(self, user=None):
    if PavloviaMenu.appData:
        if user is None and PavloviaMenu.appData['pavloviaUser']:
            user = PavloviaMenu.appData['pavloviaUser']
    if user in [PavloviaMenu.currentUser, None]:
        return  # nothing to do here. Move along please.
    PavloviaMenu.currentUser = user
    PavloviaMenu.appData['pavloviaUser'] = user
    if user in pavlovia.knownUsers:
        token = pavlovia.knownUsers[user]['token']
        try:
            pavlovia.getCurrentSession().setToken(token)
        except requests.exceptions.ConnectionError:
            logging.warning("Tried to log in to Pavlovia but no network "
                            "connection")
            return
    else:
        if hasattr(self, 'onLogInPavlovia'):
            self.onLogInPavlovia()
    if PavloviaMenu.searchDlg:
        PavloviaMenu.searchDlg.updateUserProjs()