Skip to content

fix: handle private validation URL redirect and string error messages#7543

Merged
vitormattos merged 2 commits intomainfrom
fix/private-validation-redirect
Apr 23, 2026
Merged

fix: handle private validation URL redirect and string error messages#7543
vitormattos merged 2 commits intomainfrom
fix/private-validation-redirect

Conversation

@vitormattos
Copy link
Copy Markdown
Member

Summary

When make_validation_url_private=true, the backend returns HTTP 401 with action=REDIRECT and errors as a string array. The frontend was only handling object-format errors ({message}) and not the redirect action, causing a false "Failed to validate document" message instead of redirecting to the login page.

Changes

  • Added handleValidationRedirect() to detect action=REDIRECT responses and redirect to the backend-provided URL
  • Fixed getValidationErrorMessage() to handle both string and object error formats
  • Added regression tests for both scenarios

When make_validation_url_private=true, the backend returns HTTP 401
with action=REDIRECT and errors as a string array. The frontend was
only handling object-format errors ({message}) and not the redirect
action, causing a false 'Failed to validate document' message.

Adds handleValidationRedirect() and fixes getValidationErrorMessage()
to handle both string and object error formats.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Apr 23, 2026
When make_validation_url_private=true, the backend returns HTTP 401
with action=REDIRECT and errors as a string array. The frontend was
only handling object-format errors ({message}) and not the redirect
action, causing a false 'Failed to validate document' message.

Adds handleValidationRedirect() and fixes getValidationErrorMessage()
to handle both string and object error formats.

Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the fix/private-validation-redirect branch from fb54360 to b54bd4a Compare April 23, 2026 00:53
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 17b7051 into main Apr 23, 2026
67 checks passed
@vitormattos vitormattos deleted the fix/private-validation-redirect branch April 23, 2026 00:55
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant