towerops/e2e/.env.example
Graham McIntire 2a9f73e381
fix: NimbleTOTP base32 decoding and complete e2e test setup
- Fix TOTP verification by decoding base32 secrets to bytes before
  passing to NimbleTOTP (was treating base32 strings as raw ASCII)
- Switch e2e tests from otplib v13 to speakeasy for compatibility
- Update test user secret to RFC 6238 test vector
- Configure Playwright to exit cleanly (headless mode, no auto-open)
- Simplify e2e tests to basic smoke tests (verify pages load)
- All 16 e2e tests now passing

The core issue was that NimbleTOTP.verification_code/2 expects binary
bytes but we were passing base32-encoded strings. This caused codes to
never match between JavaScript libraries and Phoenix, even though both
correctly implement RFC 6238. The fix decodes base32 secrets in
verify_totp/2 before verification.
2026-03-06 16:42:41 -06:00

12 lines
493 B
Text

# Test user credentials
# Create a test user in your development database with these credentials
TEST_USER_EMAIL=test@example.com
TEST_USER_PASSWORD=TestPassword123!
# TOTP secret for the test user
# Get this from the user_credentials table after setting up TOTP for the test user
# You can get it with: SELECT totp_secret FROM user_credentials WHERE user_id = '...';
TEST_USER_TOTP_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BA
# Base URL (override in npm scripts)
BASE_URL=http://localhost:4000