Repository navigation
Conversation
Add POST /workos/v1/admin/users/{id}/verify-email for support cases
where the sign-in code never arrives. It looks up the linked WorkOS
user, does nothing when the email is already verified, and otherwise
calls update_user with email_verified true, clears the user-edit panel
cache and logs email.admin_verified with the initiator. WorkOS failures
come back as 502 workos_api_error.
Gated by a new workos_verify_email capability that maps to edit_users,
so it is never self-service by default. The WorkOS Users rows carry
can_verify_email, and the user-edit WorkOS panel shows a Mark email
verified button next to an unverified email.
The WorkOS Users screen gets a per-row button for unverified emails the caller can verify; it confirms, posts, and marks the row verified in place. The user-edit panel button is handled by the shared admin script already loaded there, with the same confirm modal and notice.
bordoni
added this pull request to stack #84
October 17, 2026 23:03
# Conflicts: # AGENTS.md
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.
When a customer's sign-in code doesn't arrive, often because of a filter or a slow mailbox, support has no supported way to mark the WorkOS email verified, even after confirming who the person is another way.
Stacked on #77 (
feat/workos-capabilities).Changes
POST /wp-json/workos/v1/admin/users/{id}/verify-email, where{id}is the WP user ID, like the password-reset route. It looks up the linked WorkOS user, returnsalready_verified: truewithout an update when the email is already verified, and otherwise callsupdate_userwithemail_verified: true.workos_verify_emailcapability that maps toedit_users, so nobody can verify their own email by default. None of the Plugin capabilities for WorkOS user management #65 capabilities fit:workos_change_emailmaps toedit_user, which every user has on their own account.email.admin_verifiedwith the WorkOS email andinitiator_id, and clears the user-edit panel's cached WorkOS user.workos_api_errorwhen WorkOS fails, so a WorkOS 401 isn't read as the caller's own.can_verify_emailon each row). It asks for confirmation and marks the row verified in place. Rows with no linked WP user don't get it.docs/capabilities.md, README and AGENTS.md updated.Verified
AdminUsersVerifyEmailTest: logged out, an editor and a user acting on themselves get 403 with no WorkOS call. A role grantedworkos_verify_emailsucceeds. Unknown user is 404, unlinked is 409. Already verified is a no-op with no update and no log row. Success sends{"email_verified": true}, logs the initiator and clears the cache. WorkOS errors on the lookup or the update return 502 with no log row. The panel button shows only for an unverified email and only with the capability.CapabilitiesTestmatrix coversworkos_verify_email(admins only, same asedit_users), andAdminUsersRestApiTestcheckscan_verify_email.bun run buildandtsc --noEmitpass.Screenshots
Closes #66