class_docstr: Button that redirects the user to Sign with Hugging Face using OAuth.
class_docstr_tok: ["Button","that","redirects","the","user","to","Sign","with","Hugging","Face","using","OAuth","."]
code: def _check_login_status(self, request: Request) -> LoginButton:
      # Each time the page is refreshed or loaded, check if the user is logged in and adapt label
      session = getattr(request, "session", None) or getattr(
          request.request, "session", None
      )
      if session is None or "oauth_info" not in session:
          return LoginButton(value=self.value, interactive=True)
      else:
          username = session["oauth_info"]["userinfo"][
              "preferred_username"
          ]
          signed_in_text = self.signed_in_value.format(username)
          return LoginButton(signed_in_text, interactive=False)
  
file_path: gradio/gradio/components/login_button.py
imports: from __future__ import annotations
  import warnings
  from typing import Literal
  from gradio_client.documentation import document, set_documentation_group
  from gradio.components import Button
  from gradio.context import Context
  from gradio.routes import Request
label_desc: Use image node_id 3 for calling the LoginButton obj's underlying member method code with example usage: obj._check_login_status(request) and returns: LoginButton, LoginButton