Skip to content

Comments

Fix user creation for stale sessions of deleted users#75

Merged
sergeychernyshev merged 5 commits intomainfrom
69-user-is-not-properly-created-if-starts-from-a-session-that-corresponds-to-non-existent-user
Feb 22, 2026
Merged

Fix user creation for stale sessions of deleted users#75
sergeychernyshev merged 5 commits intomainfrom
69-user-is-not-properly-created-if-starts-from-a-session-that-corresponds-to-non-existent-user

Conversation

@sergeychernyshev
Copy link
Member

@sergeychernyshev sergeychernyshev commented Feb 22, 2026

This PR fixes an issue where a user was not properly recreated if they started an auth flow while having a stale session cookie pointing to a deleted user ID.

The fix involves verifying if the user has an existing profile in UserDO even if a userId was found in the session cookie or credential mapping. If the profile is empty (which happens after a user is deleted via the admin API), the user is treated as a new user, ensuring their profile is populated, they are registered in the SystemDO index, and a new personal account is created.

Closes #69

✨ Assisted by AI: Gemini

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 22, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
startup-api abb8186 Feb 22 2026, 08:36 PM

@sergeychernyshev sergeychernyshev merged commit 2b39734 into main Feb 22, 2026
2 checks passed
@sergeychernyshev sergeychernyshev deleted the 69-user-is-not-properly-created-if-starts-from-a-session-that-corresponds-to-non-existent-user branch February 22, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User is not properly created if starts from a session that corresponds to non-existent user

1 participant