You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New WP user whose email already exists in WorkOS stays unlinked silently #59
When WordPress creates a user whose email already belongs to a WorkOS user (a guest checkout, an import, an admin creating the account), push_user_to_workos() gets email_not_available back from WorkOS and only logs it. The WordPress user stays unlinked until that person signs in. Anything that needs the WorkOS ID before that (licensing, entitlements) quietly skips.
sync_existing_user() has the same gap.
Fix
On email_not_available:
look up the existing WorkOS user by email;
store it on the WordPress user as a pending match, not a link (e.g. _workos_pending_match = WorkOS ID + time). The plugin must not link by email without the person proving they own it; Re-link Protection still applies.
fire workos_user_push_failed( $user_id, WP_Error $error, ?string $existing_workos_id ) so the site can tell the customer to sign in with their existing account;
log it.
When that user later signs in and links, clear the pending marker. workos_user_linked already fires there.
Both create paths send email_verified => true for every new WordPress user, even when nobody verified the address. Add a workos_push_user_email_verified( bool $verified, int $user_id, array $userdata ) filter. The default stays true in 1.0.11, so behaviour doesn't change in a patch release. Whether to flip the default goes to 1.1.0.
Done when
Tests cover the pending marker, the action and its arguments, clearing on link, and the new filter.
Activity