<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GET(self, *args, **kwargs):
 """ Checks if user is authenticated and calls GET_AUTH or performs logout. Otherwise, returns the login template. """

        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(), False)

            return self.GET_AUTH(*args, **kwargs)
        else:
            return self.template_helper.get_renderer().auth(self.user_manager.get_auth_methods(), False)