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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,10 @@
17
17
- 7 new activity-log event types: `email_change.initiated|confirmed|cancelled|expired|conflict_blocked|commit_failed|admin_bypass`.
18
18
- 40 new WPUnit tests across 6 suites under `tests/wpunit/ChangeEmail*Test.php`.
19
19
- See [`docs/change-email.md`](docs/change-email.md).
20
+
-**Per-form magic-code registration toggles** ([CONS-350](https://linear.app/nexcess/issue/CONS-350)) (#25) — two independent per-environment checkboxes on the WorkOS settings page gate whether an unknown email signing in with a magic code provisions a new account.
21
+
-**Email Code Registration** controls the default sign-in form (`/login/`); **Legacy Email Code Registration** controls the legacy form (`/login/legacy/`). The legacy profile slug (`legacy` by default) is filterable via `workos_legacy_profile_slug` and resolved from the `$profile` that `BaseEndpoint::resolve_profile()` already produces.
22
+
- When a form's toggle is off, `POST /auth/magic/send` skips the WorkOS call for unknown addresses and still returns `200 ok: true`, and `POST /auth/magic/verify` early-returns a generic `400 workos_authkit_invalid_code` instead of proceeding to `LoginCompleter`/`UserSync` — closing the account-enumeration leak where `send` previously returned `404 workos_authkit_no_account`.
23
+
- New options `allow_magic_code_registration` and `allow_legacy_magic_code_registration` (both default `true`, preserving historical behavior). `render_checkbox()` now honors a `default` key so the boxes render checked before first save.
Copy file name to clipboardExpand all lines: readme.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,7 @@ WorkOS is provided by WorkOS, Inc.
178
178
= 1.0.6 - Unreleased =
179
179
180
180
* New: WorkOS-verified change-email flow. Self-service `[workos:change-email]` shortcode + admin row action on `wp-admin/users.php` + panel on the user-edit screen. The new address must be confirmed via a hashed token emailed by the plugin (because WorkOS's `email_verification` endpoints can't verify a *pending* change); the old address simultaneously receives a one-click cancel link. Configurable conflict policy (`block` default, `allow_orphan`, `merge_request`) keeps the new email from silently overwriting another local WP user. Commits to WorkOS first (`update_user`) and then mirrors into WordPress, with a 60-second in-progress transient that short-circuits the webhook fan-back. Eight new filters, five new actions, seven new activity-log events, and 40 new WPUnit tests. See `docs/change-email.md`. (#22)
181
+
* New: Per-form magic-code registration toggles. Two independent per-environment checkboxes — Email Code Registration (default sign-in form, `/login/`) and Legacy Email Code Registration (legacy `/login/legacy/` form) — gate whether an unknown email signing in with a magic code provisions a new account. When a form's toggle is off, `POST /auth/magic/send` silently skips the WorkOS call for unknown addresses and still returns `200 ok: true`, and `POST /auth/magic/verify` returns a generic `400 workos_authkit_invalid_code` instead of creating the user — closing the account-enumeration leak where the endpoint previously returned `404 workos_authkit_no_account`. Both toggles default on to preserve existing behavior. ([CONS-350](https://linear.app/nexcess/issue/CONS-350)) (#25)
'label' => __( 'Allow creating a new account when someone signs in with an email code for an address that has no account. When off, unknown emails receive no code and no account is created.', 'integration-workos' ),
'label' => __( 'Allow creating a new account when a legacy customer signs in with an email code for an address that has no account. When off, unknown emails receive no code and no account is created.', 'integration-workos' ),
703
+
'default' => true,
704
+
]
705
+
);
706
+
681
707
// --- Audit Logging section ---
682
708
add_settings_section(
683
709
'workos_audit',
@@ -1268,10 +1294,16 @@ public function render_select( array $args ): void {
1268
1294
/**
1269
1295
* Render a checkbox.
1270
1296
*
1271
-
* @param array $args Field arguments.
1297
+
* @param array $args {
1298
+
* Field arguments.
1299
+
*
1300
+
* @type string $name Option name (supports `group[key]` syntax).
1301
+
* @type string $label Checkbox label.
1302
+
* @type bool $default Value shown when the option has never been saved. Defaults to false.
0 commit comments