head内に下記スクリプトを追加

<!-- /layout/theme.liquid -->
<head>
<!-- 以下一行追加 -->
<script src="<https://cdn.auth0.com/js/auth0-spa-js/1.20/auth0-spa-js.production.js>"></script>
<head>

ログイン、ログアウトボタンを追加したい箇所に以下のコードを追加する(デザインなどはそれぞれで変えてください)

<button id="auth0-login" onClick="login();">
  login
</button>

<button id="auth0-logout" onClick="logout();">
  Logout
</button>

<script>
  const config = {
    domain: '***',
    clientId: '***',
    redirectUri: '***',
  };
  let auth0 = null;

  const login = async () => {
    localStorage.setItem(
      auth0.options.client_id + "::preLoginHref",
      window.location.href
    );
    await auth0.loginWithRedirect();
  }

  const logout = () => {
    auth0.logout();
  }

  /**
  * 現在のログイン状況に応じてUIを変更する
  */
  const updateUI = async () => {
    const isAuthenticated = await auth0.isAuthenticated();

    const loginButton = document.getElementById("auth0-login");
    const logoutButton = document.getElementById("auth0-logout");
  
    if (!isAuthenticated) {
      // ログインしてない
      loginButton.style.display = "block";
      logoutButton.style.display = "none";
    } else {
      // ログインしている
      loginButton.style.display = "none";
      logoutButton.style.display = "block";
      const token = await auth0.getTokenSilently(); // localstorageからaccesstokenを取得
      console.log(token);
      const user = await auth0.getUser();
      console.log(user);
      return;
    }
  };

  /**
  * auth0clientを作成する
  */
  const configureClient = async () => {
    try {
      auth0 = await createAuth0Client({
        domain: config.domain,
        client_id: config.clientId,
        redirect_uri: config.redirectUri,
        useFormData: true,
        cacheLocation: "localstorage",
      });
    } catch (e) {
      console.error(e);
    }
  };

  /**
  * パラメータにcode, stateが含まれている場合、ログイン後なのでpreLoginHrefに飛ばす
  */
  const checkForParameters = async () => {
    const query = window.location.search;

    if (query.includes("code=") && query.includes("state=")) {
      await auth0.handleRedirectCallback();

      const preLoginHref = localStorage.getItem(
        auth0.options.client_id + "::preLoginHref"
      );

      if (preLoginHref) {
        localStorage.removeItem(config.client_id + "::preLoginHref");
        window.location.href = preLoginHref;
      }
    }
  }
  
  const handleAuth0 = async () => {
    await configureClient();
    await checkForParameters();
    updateUI();
  };
  
  handleAuth0();
</script>

導入後のログイン挙動