Skip to content

docs: explain gateway auth action pattern#1331

Open
memleakd wants to merge 1 commit into
codeigniter4:developfrom
memleakd:docs/mfa-gateway-actions
Open

docs: explain gateway auth action pattern#1331
memleakd wants to merge 1 commit into
codeigniter4:developfrom
memleakd:docs/mfa-gateway-actions

Conversation

@memleakd
Copy link
Copy Markdown
Contributor

Description

This follows up on #1328 and @datamweb's idea about using a conditional action as a small gateway for more complex login flows.

I tried the pattern locally, and it works: an app can register one login action, let appliesTo() decide whether it should run for the user, and then handle the actual method choice inside the action's normal show() / handle() / verify() flow.

This PR adds that pattern to the Authentication Actions docs.

The important detail is that the gateway should still behave like one Shield action. It should return one type from getType() and use that as the pending action identity. The available methods, like email or SMS, should be handled inside the gateway instead of becoming separate action identities.

This documents a useful app-level pattern for people who need one login action to offer more than one verification method.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
@datamweb datamweb added the documentation Improvements or additions to documentation label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants