Skip to content

Add a special unauthenticated route for demo on dev and staging #816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2025
Merged

Conversation

nid90
Copy link
Member

@nid90 nid90 commented May 23, 2025

Why

Have a public demo page for sales and marketing purposes where we don't have to create external viewer credentials

This addresses

  • Allows one organization on staging environment to be selected as "demo organization" and all the data for the organization will be public (available without requiring login) on <staging-url>/demo.
  • Updates anonymize script to allow multiple apps to be anonymized at the same time
  • Adds new columns in anonymize script

The following setup is required beforehand:

org = Accounts::Organization.create!(status: "active", name: "Demo org name", created_by: "[email protected]")
demo_email = "[email protected]"
email_authentication = Accounts::EmailAuthentication.find_or_initialize_by(email: demo_email)
demo_user = Accounts::User.find_or_create_by!(full_name: "Demo User", preferred_name: "Demo User", admin: false, unique_authn_id: demo_email)
email_authentication.update!(password: <some password>, confirmed_at: DateTime.now, user: demo_user)
org.memberships << Accounts::Membership.new(user: demo_user, organization: org, role: "viewer")

Also, requires the following env variables:

DEMO_ORG_SLUG=<demo-org-slug>
DEMO_USER_SLUG=<demo-user-slug>

Additionally, a flipper flag must be enabled for the demo organization - demo_mode.

@kitallis kitallis marked this pull request as ready for review May 28, 2025 13:51
@nid90 nid90 requested a review from kitallis May 28, 2025 16:46
@kitallis kitallis merged commit df77a0d into main May 29, 2025
4 checks passed
@kitallis kitallis deleted the demo branch May 29, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants