Skip to content

feat: allow username/email login and add PostHog hooks#67

Merged
gregagi merged 1 commit intomainfrom
task/work-on-this-20260226
Feb 26, 2026
Merged

feat: allow username/email login and add PostHog hooks#67
gregagi merged 1 commit intomainfrom
task/work-on-this-20260226

Conversation

@gregagi
Copy link
Copy Markdown
Owner

@gregagi gregagi commented Feb 26, 2026

Summary

This PR addresses the open WORK ON THIS Clawrn tasks by shipping:

  1. Login identifier supports username or email

    • ACCOUNT_LOGIN_METHODS now allows both username and email.
    • Login input copy updated to "Email or username".
    • Removed hardcoded name="username" override on the login field so allauth receives the proper login field.
  2. PostHog integration (optional, env-driven)

    • Added POSTHOG_KEY and POSTHOG_HOST settings/env support.
    • Added analytics_settings context processor.
    • Injected PostHog bootstrap/init snippet into both base templates:
      • frontend/templates/base_landing.html
      • frontend/templates/base_app.html
    • Updated .env.example with PostHog vars.
  3. Questions link coverage in base templates

    • Added regression test coverage asserting both base templates include the Questions navigation link.

Tests

Ran targeted tests:

ENVIRONMENT=test SECRET_KEY=test SITE_URL=http://testserver DJANGO_READ_DOT_ENV=0 \
  uv run pytest \
  apps/core/tests/test_views.py::TestLoginView \
  apps/core/tests/test_views.py::TestAnalyticsScripts \
  apps/pages/tests.py::PagesMarkdownEndpointsTestCase::test_base_templates_include_questions_link_in_navigation -q

All passed.

@gregagi gregagi merged commit ad8d34f into main Feb 26, 2026
1 check passed
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.

1 participant