Skip to content

Conversation

@JudahSan
Copy link
Collaborator

@JudahSan JudahSan commented Aug 24, 2025

Summary

Renamed attempt_verification? to attempt_verification to accurately reflect
its behavior (network call with retries and logging, not a simple predicate).
Updated the verify method to call the corrected method.

Problem

The mismatch between the method definition (attempt_verification?) and its call
(attempt_verification) triggered a runtime error during user authentication:


NameError: undefined local variable or method `attempt_verification`
app/services/turnstile\_verifier.rb:30\:in `TurnstileVerifier#verify'
  app/controllers/users/sessions_controller.rb:18:in `Users::SessionsController#verify\_turnstile'

This caused signup/login requests to fail with a 500 Internal Server Error.

Fix

  • Rename attempt_verification?attempt_verification

Impact

  • User signup/login with Turnstile verification now works as expected
  • Prevents authentication flow from breaking due to undefined method errors

- Rename `attempt_verification?` to `attempt_verification` to better reflect that it performs retries, logging, and network calls (not just a simple predicate check)
- Update `verify` to call the correct method
- Prevents `NameError: undefined local variable or method 'attempt_verification'` during user login
- Clarify intent and avoid misleading RuboCop predicate naming warnings
@JudahSan JudahSan requested a review from adamswonder August 24, 2025 02:02
@JudahSan JudahSan added the bug Something isn't working label Aug 24, 2025
…and update method definition to comply with naming conventions
@adamswonder adamswonder merged commit c268965 into African-Ruby-Community:main Aug 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants