bb-plane-fork/apps/api/plane/authentication
binarybeach c0cfbb2bdc binarybeachio: trusted view — mirror OAuth adapter create-shape (Profile, username, is_email_verified)
Plane's OAuth adapter (apps/api/plane/authentication/adapter/base.py:289-342)
creates User AND Profile when a new identity arrives. My trusted view was
calling User.objects.get_or_create() without the Profile, so the SPA's
/api/users/me/profile/ 404'd and the SPA bounced the user back to /login
in an onboarding loop.

Mirror the adapter's full create-shape: random username (uuid hex),
first/last names from JWT claims, is_password_autoset=True,
is_email_verified=True, random password (so Django's auth hash is non-empty
for break-glass), then Profile.objects.create(user=user). Wrapped in a
transaction so partial creation can't leave the DB inconsistent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 23:55:25 -10:00
..
adapter binarybeachio: Bucket-4 trusted-JWT auth — replaces in-place github.py patch 2026-05-03 20:24:48 -10:00
middleware chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
provider binarybeachio: Bucket-4 trusted-JWT auth — replaces in-place github.py patch 2026-05-03 20:24:48 -10:00
utils chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
views binarybeachio: trusted view — mirror OAuth adapter create-shape (Profile, username, is_email_verified) 2026-05-03 23:55:25 -10:00
__init__.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
apps.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
rate_limit.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
session.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
urls.py binarybeachio: Bucket-4 trusted-JWT auth — replaces in-place github.py patch 2026-05-03 20:24:48 -10:00