Manage Admin Auth

Manage access to your guestbook admin dashboard.

Managing Users

Allow Admin Users

In the event you want to allow more users to manage your guestbook, you can allow-list their Google accounts as admin users.

Run the following command in your terminal to allow-list a Google account as your admin user:

npx y2k-guestbook allow-admin example@gmail.com

Revoke Admin Users

Run the following command in your terminal to revoke admin access from a Google account:

npx y2k-guestbook delete-admin example@gmail.com

Configure Unauthorized Access Error

If you want to customize the error message that is displayed to users who are not authorized to access the admin dashboard after they attempted to sign in, you can do so by editing the hardcoded message in AdminAuthErrorOverlay.tsx:

        <h2 id="admin-auth-error-title" className="admin-auth-error-title">
          Oh no!
        </h2>
        <p id="admin-auth-error-body" className="admin-auth-error-body">
          The Google account you used to sign in isn&apos;t an administrator.
        </p>
        <button type="button" className="admin-auth-error-ok" onClick={dismiss}>
          Close
        </button>

Publish Admin Auth Client

Log in to your Google Cloud console and select your project:

  1. In the left sidebar, click APIs & Services, then select OAuth consent screen.

  2. Click Branding and enter your:

    • App name — This will be displayed instead of your generic Supabase project URL.
    • User support email — This will be displayed in the "Contact us" link in the Google OAuth consent screen.
  3. Under App domain, enter:

    • Application home page — The URL of your guestbook application.

    • Application privacy policy link — The URL of your guestbook's privacy policy.

    • Application terms of service link — The URL of your guestbook's terms of service.

  4. Under Authorized domains, enter any Authorized domains # where you intend to serve your guestbook application.

  5. In Developer contact information, enter your contact email.

  6. Click Save.

What's Next

Enable notifications and customize guestbook settings: