docs: def login(session, user, password, database=None, server=None):
      """Logs into a MyGeotab server and stores the returned credentials.
  
      :param session: The current Session object.
      :param user: The username used for MyGeotab servers. Usually an email address.
      :param password: The password associated with the username. Optional if `session_id` is provided.
      :param database: The database or company name. Optional as this usually gets resolved upon authentication.
      :param server: The server ie. my23.geotab.com. Optional as this usually gets resolved upon authentication.
      """
      if not user:
          user = click.prompt("Username", type=str)
      if not password:
          password = click.prompt("Password", hide_input=True, type=str)
      try:
          with click.progressbar(length=1, label="Logging in...") as progressbar:
              session.login(user, password, database, server)
              progressbar.update(1)
          if session.credentials:
              click.echo('Logged in as: %s' % session.credentials)
              session.load(database)
          return session.get_api()
      except mygeotab.AuthenticationException:
          click.echo('Incorrect credentials. Please try again.')
          sys.exit(0)