Skip to content

feat: ignore robots when accessing magic link#1294

Merged
michalsn merged 3 commits into
codeigniter4:developfrom
michalsn:feat/ignore-robots
Nov 3, 2025
Merged

feat: ignore robots when accessing magic link#1294
michalsn merged 3 commits into
codeigniter4:developfrom
michalsn:feat/ignore-robots

Conversation

@michalsn

Copy link
Copy Markdown
Member

Description
This PR updates the magic link controller to ignore requests originating from bots or crawlers.

See #1293 for more details.

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

@michalsn michalsn added the enhancement New feature or request label Oct 31, 2025

@datamweb datamweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalsn, thank you. I know the main focus of the discussion has been on the magic link, but I remember someone mentioning a similar issue regarding the activation link as well.
I’d like to know what your plan is regarding that issue?

@lonnieezell lonnieezell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@datamweb

datamweb commented Oct 31, 2025

Copy link
Copy Markdown
Collaborator

Since the list of bots was recently updated in CodeIgniter version 4.7, but Shield remains compatible with earlier versions, I think it would be helpful to mention in Shield’s documentation that the bot list can be updated through the app/Config/UserAgents.php file.

@michalsn

michalsn commented Nov 1, 2025

Copy link
Copy Markdown
Member Author

@datamweb I have added the docs.

We can add the same functionality to all actions in a separate PR. I think the right place for that would be https://github.com/codeigniter4/shield/blob/develop/src/Controllers/ActionController.php#L83, right?

@datamweb

datamweb commented Nov 1, 2025

Copy link
Copy Markdown
Collaborator

@datamweb datamweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks.

@michalsn michalsn merged commit 93091f3 into codeigniter4:develop Nov 3, 2025
36 checks passed
@michalsn

michalsn commented Nov 3, 2025

Copy link
Copy Markdown
Member Author

Thank you for your review!

@michalsn michalsn deleted the feat/ignore-robots branch November 3, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants