code: def POST(self, *args, **kwargs):
          
          if self.user_manager.session_logged_in():
              if not self.user_manager.session_username() and not self.__class__.__name__ == "ProfilePage":
                  raise web.seeother("/preferences/profile")
  
              if not self.is_lti_page and self.user_manager.session_lti_info() is not None:  # lti session
                  self.user_manager.disconnect_user()
                  return self.template_helper.get_renderer().auth(self.user_manager.get_auth_methods_fields(), False)
  
              return self.POST_AUTH(*args, **kwargs)
          else:
              user_input = web.input()
              if "login" in user_input and "password" in user_input:
                  if self.user_manager.auth_user(user_input["login"].strip(), user_input["password"]) is not None:
                      return self.GET_AUTH(*args, **kwargs)
                  else:
                      return self.template_helper.get_renderer().auth(self.user_manager.get_auth_methods(), True)
              else:
                  return self.template_helper.get_renderer().auth(self.user_manager.get_auth_methods(), False)
docs: Checks if user is authenticated and calls POST_AUTH or performs login and calls GET_AUTH.
          Otherwise, returns the login template.