Skip to content

Fix useLogoutAccessDenied should not throw when no redirectTo is provided #10763

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

Conversation

carloshv93
Copy link
Contributor

@carloshv93 carloshv93 commented May 30, 2025

Problem

Undefined redirectTo values throws error
Fix #10172
Supersedes #10177

Solution

Create a handleRedirect function to properly handle either valid URL or undefined URLS

How To Test

Steps to reproduce

Follow steps from #10177

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

Evidence

image

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Would you mind adding some too?

@carloshv93
Copy link
Contributor Author

Thanks for the PR! Would you mind adding some too?
@djhi, I might not have understood what you're requesting. Could you clarify your change request a bit more? please

@djhi
Copy link
Collaborator

djhi commented Jun 2, 2025

Thanks for the PR! Would you mind adding some too?
@djhi, I might not have understood what you're requesting. Could you clarify your change request a bit more? please

Oups, sorry for the typo... Can you add some unit tests as well?

…er_false_and_without_redirectTo_causes_an_error' of github.com:carloshv93/react-admin into hotfix/10172-reject_promise_in_checkError_with_logoutUser_false_and_without_redirectTo_causes_an_error
@carloshv93
Copy link
Contributor Author

Thanks for the PR! Would you mind adding some too?
@djhi, I might not have understood what you're requesting. Could you clarify your change request a bit more? please

Oups, sorry for the typo... Can you add some unit tests as well?

Unit test added

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Thanks for adding a test!

@slax57 slax57 added this to the 5.8.5 milestone Jun 19, 2025
@slax57 slax57 merged commit 8283c84 into marmelab:master Jun 19, 2025
0 of 2 checks passed
@slax57 slax57 changed the title fix(useLogoutAccessDenied): handle errors without redirect Fix useLogoutAccessDenied should not throw when no redirectTo is provided Jun 19, 2025
@djhi djhi modified the milestones: 5.8.5, 5.9.0 Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Reject promise in checkError with logoutUser: false and without redirectTo causes an error
3 participants