feat: generic coach signup page + JWT auth fix #32
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "30-generic-coach-signup-jwt-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds open-access coach signup routes (
/coach/signup) so Marcus can share one link for all coaches, and fixes JWTtoken_issuerinAuthConfigso admin endpoints authenticate correctly againstpal-e-authtokens.Changes
src/basketball_api/main.py-- Addedtoken_issuer="pal-e-auth"toAuthConfigconstructor so JWT decode validates theissclaim correctly.src/basketball_api/routes/coach.py-- AddedGET /coach/signup(renders branded agreement form with empty fields, no token required) andPOST /coach/signup(creates Coach record withtenant_id=1, signs agreement, generates invite token, redirects to Stripe Connect onboarding). Handles duplicate emails: unsigned coaches get updated, signed coaches see "already registered" page.tests/test_coach_signup.py-- Tests for GET signup page, POST happy path with Stripe redirect, agreement checkbox validation, Stripe failure error display, duplicate email handling for both signed and unsigned coaches.Test Plan
ruff check src/ tests/passesruff format --check src/ tests/passespytest tests/ -vpasses (requires Postgres -- verified via CI)/coach/signup-- should render branded agreement formiss: pal-e-authReview Checklist
tenant_id=1for Westside (matches issue spec)/coach/onboard/*routes unchangedRelated
plan-2026-03-08-tryout-prep(Phase 3a-iii)