Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: using a more precise return #1146

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

warcooft
Copy link
Contributor

@warcooft warcooft commented Jul 17, 2024

Description

The previous behavior may look like there is no problem, but when the user submits the verification code it will automatically change the state of the URL to http://localhost:8080/auth/a/verify.

When the codes don't match and they accidentally refresh the page it will cause a 404 error because the route auth/a/verify with the GET method does not exist.

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

@kenjis kenjis added tests needed Pull requests that need tests enhancement New feature or request labels Jul 17, 2024
@kenjis
Copy link
Member

kenjis commented Jul 17, 2024

Please write test code to prove your code works fine in all PRs.
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing

@kenjis kenjis removed the tests needed Pull requests that need tests label Jul 24, 2024
@kenjis
Copy link
Member

kenjis commented Aug 26, 2024

The following test fails. Please fix your code. Thank you.

There was 1 failure:

1) Tests\Controllers\RegisterTest::testRegisterActionRedirectsIfTokenNotMatch
Do not see 'The code was incorrect.' in response.
Failed asserting that false is true.

/home/runner/work/shield/shield/vendor/codeigniter4/framework/system/Test/TestResponse.php:436
/home/runner/work/shield/shield/tests/Controllers/RegisterTest.php:360
phpvfscomposer:///home/runner/work/shield/shield/vendor/phpunit/phpunit/phpunit:97

https://github.com/codeigniter4/shield/actions/runs/9990325709/job/27721717998?pr=1146

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.

2 participants