feat(01): Teen delegated login - #43
Open
tpaulshippy wants to merge 9 commits into
Open
Conversation
…profile lock (roadmap 01) - Unique constraint + index on active Profile.oauth_email; case-insensitive login lookup excluding soft-deleted profiles and preferring parent login - SyftRefreshToken issues parent-user JWTs with is_teen_delegated + active_profile_id claims; forwarded via jwt_template.html deep link and /app/login web redirect - IsParentSession / IsParentSessionForWrites guard profiles, bots, /api/user PIN, and account deletion; redacted GET /api/user for teens - Profile lock enforced in chat creation/reply, chats, decks, flashcards querysets; new GET /api/profiles/self read-self endpoint for teens - oauth_email on ProfileSerializer (empty string unbinds); tutorial copy now describes invite-email teen sign-in - New test suite test_delegated_login.py (31 tests)
… 01) Idempotent seeding of parent user e2e-test-user / testpassword123, teen profile Maya bound to [email protected], sibling Leo, default AiModel + Penelope bot for fresh databases.
…email binding UI (roadmap 01) - tokens.ts stores is_teen_delegated + active_profile_id claims; helpers getSessionMode/sessionFromQueryParams parse login query flags - useAuthBootstrap locks delegated devices to /profiles/self and skips the parent profile-repair path; login.tsx skips PIN gate/caching for teens - useSessionMode hook drives NavigationDrawer (Chats+Flashcards only for teens) and _layout redirect of /parent/* deep links to /chat - setSelectedProfile refuses changes when delegated - profileEditor gains 'Teen sign-in email' with validation, help copy, Remove teen sign-in action, and testIDs on new interactive elements
…on (roadmap 01) - New tokens.test.ts (query flag parsing, getSessionMode claims, clearUser claim reset), useAuthBootstrap deep-link lock tests, NavigationDrawer mode tests, useDelegatedRouteGuard redirect tests - Extract /parent/* guard from _layout into useDelegatedRouteGuard for testability - Extend '@/api/tokens' mocks in existing suites for the new getSessionMode surface; add delegated-lock cases to useSelectedProfile tests
- e2e/01-teen-login.e2e.js: parent drawer intact, bind/unbind teen email
round-trip via profile editor with API verification, delegated session
hides Settings, /parent/* deep link bounces off parent area; teen JWTs
minted via backend venv (SyftRefreshToken.for_delegated_profile)
- testIDs: drawer-menu-button, drawer items, menu-profiles,
profile-card-{name}; index.tsx honors injected e2eInitialRoute under
e2eTestMode
- Backend: fix I001 import ordering in permissions, serializers, views, tests - Frontend: add jest/e2e globals to eslint config
tpaulshippy
pushed a commit
that referenced
this pull request
Aug 26, 2026
Screenshot now shows the teen login screen with Google/Apple sign-in buttons.
Screenshot now shows the teen login screen with Google/Apple sign-in buttons.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap 01: Teen Delegated Login
Implements #53.
What changed
is_teen_delegatedclaim,GET /api/profiles/self, permission gating (teens can't mutate parent resources)Manual demo
manage.py seed_e2e_teen_login→ log in as parent[email protected][email protected]) → app locks to Maya, no Settings accessEvidence
https://github.com/tpaulshippy/bots/raw/feature/roadmap-01-teen-login/evidence/pr43-teen-login.mp4