bb-plane-fork/apps/api/plane/authentication/views
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
..
app binarybeachio: trusted view — mirror OAuth adapter create-shape (Profile, username, is_email_verified) 2026-05-03 23:55:25 -10:00
space [GIT-44] refactor(auth): add PASSWORD_TOO_WEAK error code (#8522) 2026-02-13 18:51:33 +05:30
__init__.py binarybeachio: Bucket-4 trusted-JWT auth — replaces in-place github.py patch 2026-05-03 20:24:48 -10:00
common.py [GIT-44] refactor(auth): add PASSWORD_TOO_WEAK error code (#8522) 2026-02-13 18:51:33 +05:30