Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.

Branded OAuth consent screen (wp_native_auth_oauth_consent_template) - #395

Merged
chubes4 merged 1 commit into
mainfrom
feat/394-oauth-consent-screen
Sep 12, 2026
Merged

chubes4 merged 1 commit into
mainfrom
feat/394-oauth-consent-screen

Conversation

@chubes4

@chubes4 chubes4 commented Sep 12, 2026

Copy link
Copy Markdown
Member

What

Branded OAuth consent screen for Extra Chill, served through wp-native-auth's wp_native_auth_oauth_consent_template seam.

  • templates/oauth-consent.php (new) — the template. Full theme chrome via get_header() / get_footer() (leaderboard-template precedent), content built only from design-system classes. Discards the default template's standalone <!DOCTYPE html> document and inline <style> entirely.
  • inc/wp-native-bridge.php — registers the filter (+ header docblock updated). The bridge is the canonical wp-native-auth integration surface and is already conditionally loaded only when wp-native-auth is active, so the registration ships behind the same guard.

Fixes #394

Form contract

Copied verbatim from wp-native-auth/inc/oauth-consent-form.php (upstream chubes4/wp-native):

  • wp_nonce_field( 'wp_native_auth_oauth_consent' ) → renders _wpnonce (checked by the decision handler as $body['_wpnonce'])
  • <input type="hidden" name="oauth_request" value="<?php echo esc_attr( $args['bundle'] ); ?>"> — bundle rendered verbatim, never rebuilt
  • <input type="hidden" name="oauth_signature" value="<?php echo esc_attr( $args['signature'] ); ?>"> — same
  • <button type="submit" name="oauth_decision" value="approve"> / value="deny", in method="post" action=""

Verified by rendering the template with representative $args (both with client_uri and with a raw client id + resource present): all four fields present with exact names, bundle/signature round-trip unmodified.

CSS classes used (all from themes/extrachill/design-system.html)

Class Where defined in design-system.html
.card Component examples — "Card" example + .card/.card p rules
.btn Component examples — Buttons example + .btn rule
.btn--primary Approve button
.btn--danger Deny button
.notice Component examples — Notices example + .notice rule
.notice--info Revoke-at-any-time line

No CSS was added — no stylesheet, no <style> block, no inline styles. git diff --stat shows template + filter registration only (2 files, +126).

Copy

  • Heading: "Connect {app} to your Extra Chill account" — app name linked to client_uri when present (plain <strong> otherwise, e.g. when the client is unnamed and the raw id is shown).
  • Body: "{App} is asking for permission to act as you on Extra Chill. Approving gives it access as your account, with the permissions you already have and no more. There are no partial permissions to choose from — you either approve or deny the whole connection."
    • States the grant plainly (acts as you, inherits your capability set, nothing more) and makes the all-or-nothing nature explicit so nobody expects per-permission control.
    • Deliberately no scope display: there is exactly one scope, so showing it would imply granularity that doesn't exist. The RFC 8707 resource is shown when requested ("This connection is scoped to the resource …") since that is a real, user-meaningful restriction.
  • Application ID rendered in <code> — a trust moment; lets the user verify the client identity they're approving even when client_name is self-reported.
  • notice--info: "You can revoke this access at any time."
  • Button labels: Approve / Deny (values are the contract, labels are free — kept crisp).

Notes: gaps in the shipped theme CSS (no workarounds added, per anti-scope)

The design system documents these components, but the currently shipped theme CSS does not define them yet — design-system.html defines them only in its own demo <style>, and style.css/assets/css/* have no .card, .btn*, or double-dash .notice--* rules. Until the theme ships them, this screen renders structurally correct (theme chrome + base .notice rule exist) but the card/buttons/notice accent will be unstyled. Flagging rather than papering over:

  1. .card, .btn, .btn--primary, .btn--danger, .notice--info — not in shipped theme CSS. (.notice itself is.)
  2. .notice--warning exists in the design system but not in style.css, which only has single-dash -success/-info/-error variants. I used notice--info since even the base .notice rule renders sanely today.
  3. Design system documents no action-row/button-row component, so the two decision buttons are siblings inside a <p> (.btn is display:inline-block, so they flow side by side with no extra CSS).

Verification

  • php -l clean on both touched files.
  • Template renders with representative $args in both variants (named client with client_uri; raw client id with resource set).
  • All output escaped: esc_html / esc_attr / esc_url throughout, i18n via extrachill-users text domain.
  • No changes to wp-native-auth; no new CSS; no build steps, settings, or options.

@homeboy-ci

homeboy-ci Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Homeboy Results — extrachill-users

Review lint

⚠️ review lint — inconclusive

ℹ️ Auto-fix: homeboy refactor extrachill-users --path /home/runner/work/extrachill-users/extrachill-users --changed-since fd7cd42 --from lint --write
ℹ️ Some issues may require manual fixes
ℹ️ Full options: homeboy self docs commands/lint
Deep dive: homeboy review lint extrachill-users --changed-since fd7cd42

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-extrachill-users-review-lint-homeboy-Linux-php8.4-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-extrachill-users-review-lint-homeboy-Linux-php8.4-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/extrachill-users/actions/runs/34696006340

Review test

❌ review test — invalid evidence

ℹ️ Add or route a test for the changed source, or run the full suite: homeboy review test extrachill-users
ℹ️ If these changes are intentionally test-exempt, exclude them from the release/test scope so the gate can pass with a typed reason.
Deep dive: homeboy review test extrachill-users --changed-since fd7cd42

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-extrachill-users-review-test-homeboy-Linux-php8.4-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-extrachill-users-review-test-homeboy-Linux-php8.4-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/extrachill-users/actions/runs/34696006340
Tooling versions
  • Homeboy CLI: homeboy 0.373.0+d1446161f1485cc67af996a43f1bdc7381bd21ca
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: cc66f1ac
  • Action: Extra-Chill/homeboy-action@v2

@chubes4
chubes4 merged commit 3ddaeac into main Sep 12, 2026
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branded OAuth consent screen (wp_native_auth_oauth_consent_template)

1 participant