Skip to content

feat(wp-native-auth): persist browser handoff auth cookie by default - #128

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-127-wp-native
Nov 24, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-127-wp-native

Conversation

@chubes4

@chubes4 chubes4 commented Nov 24, 2026

Copy link
Copy Markdown
Member

Summary

Browser handoffs now call wp_set_auth_cookie with $remember from the new documented filter wp_native_auth_browser_handoff_remember (default true, also passed WP_User and the handoff record), so users coming from the native app stay signed in after the browser quits. Two tests cover the default and the filter returning false. The filter is documented in SCHEMAS.md.

What changed

  • inc/handoff-receiver.php: $remember = (bool) apply_filters( 'wp_native_auth_browser_handoff_remember', true, $user, $handoff ), with a docblock, passed to wp_set_auth_cookie instead of the hardcoded false
  • tests/test-browser-handoff-challenge.php: records the set_auth_cookie $expire value; new tests check that the default cookie has a future expiry and that returning false from the filter gives a session cookie (expire 0), and check the filter's arguments
  • SCHEMAS.md: documents the persistent-cookie default and the wp_native_auth_browser_handoff_remember filter in the handoff receiver section

Verification

  • 2-verify-4d78f4cca0be38f929ffed533ff556180b78872ad853bd105b87af689c025842.txt (homeboy review test wp-native-auth): passed on b5ba85c. Base main@f5a0a6b unchanged. 101448 ms; retained gate metadata.

  • ( if git diff --quiet --no-renames f5a0a6b -- ' (( if git diff --quiet --no-renames f5a0a6b7dade88835cd9533d58a307548086cd44 -- ':(literal)plugins/wp-native-auth'; then…): passed on b5ba85c. Base main@f5a0a6b unchanged. 14490 ms; retained gate metadata.

  • repro: none (no repro gate was declared, so these gates do not prove the issue).

  • CI: pending

Cook run
  • Gate 1: tree 5296cd6fc14a565cb1d4db087664ac44003302c8
  • Gate 2: tree 5296cd6fc14a565cb1d4db087664ac44003302c8

Delivery

  • Delivered: Filterable persistent cookie for browser handoff
  • Delivered: PHPUnit tests for default true and filter override false
  • Delivered: Filter documented in SCHEMAS.md (where hooks are documented)

Evidence

AI disclosure

Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served claude-opus-5-5. Cook time: 16m39s.

Implementation and reviewer documentation were written by the AI, under the direction of the Cook requester. Gates were run by Homeboy. A human reviews before merge.

Refs #127

@chubes4
chubes4 marked this pull request as ready for review November 24, 2026 17:25
@chubes4
chubes4 merged commit 5e045a1 into main Nov 24, 2026
1 check passed
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.

1 participant