Skip to content

Add WooCommerce login button placement and auto login - #684

Open
unknowndomain wants to merge 3 commits into
oidc-wp:developfrom
unknowndomain:pr/woocommerce-login
Open

unknowndomain wants to merge 3 commits into
oidc-wp:developfrom
unknowndomain:pr/woocommerce-login

Conversation

@unknowndomain

Copy link
Copy Markdown

All Submissions:

Changes proposed in this Pull Request:

Hi again! This is the second change from our site. Lots of sites add the login button to WooCommerce's login form with their own code, so we've made it a setting.

This adds a WooCommerce Login setting with four options:

  • Do not add (default, nothing changes)
  • Top of the login form / Bottom of the login form: adds the button with a small "or" divider, on My Account and on checkout's "Returning customer" form. After logging in, users return to the page they came from.
  • Auto Login - SSO: logged out visitors to My Account go straight to the identity provider, just like Auto Login does for wp-login.php. The lost password form still works, and logging out goes to the home page so users aren't sent straight back to the identity provider.

It only uses WooCommerce's own hooks, so it does nothing on sites without WooCommerce. #241 took a hook based approach to the same need; this makes it a setting instead.

Closes #93.

How to test the changes in this Pull Request:

  1. With WooCommerce active, choose "Bottom of the login form" and log out: My Account shows the password form, "or", then the button.
  2. Choose "Auto Login - SSO": visiting My Account while logged out goes to the identity provider and returns to My Account.
  3. Log out from My Account: you land on the home page.
  4. Choose "Do not add": My Account is exactly as before.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

The full PHPUnit suite passes (72 tests) and PHPCS is clean. Written with help from Claude.

Changelog entry

Feature: WooCommerce Login setting to add the login button to WooCommerce login forms, or auto login on My Account.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Liup3HxEjjGAyXaA1RZLbY

Adds a WooCommerce Login setting:

- Do not add (default, existing sites are unchanged).
- Top or Bottom of the login form: adds the login button with an "or"
  divider to WooCommerce's login forms (My Account and the checkout
  "Returning customer" form), returning users to the page they came
  from.
- Auto Login - SSO: logged out visitors to My Account go straight to
  the identity provider, like Auto Login for wp-login.php. The lost
  password form is kept, and WooCommerce's default logout redirect goes
  to the home page so users are not sent straight back to the identity
  provider.

Only WooCommerce's own hooks are used, so nothing happens on sites
without WooCommerce.

Fixes oidc-wp#93

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Liup3HxEjjGAyXaA1RZLbY
@daggerhart

Copy link
Copy Markdown
Collaborator

Thanks for this, and for including tests. It changes login and redirect behavior, so it needs a closer review than the current release allows. Leaving it open for now.

@daggerhart
daggerhart requested a review from mhull as a code owner November 17, 2026 14:47
@unknowndomain

Copy link
Copy Markdown
Author

Makes sense, we're now using it in production at southlondonmakerspace.org from the fork, so hopefully we'll pick up any early issues before the next release/opportunity to review.

This branch has not been deployed

No deployments
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.

Auto Login - SSO on Woocommerce login page

2 participants