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

BUG: Login As (user impersonation) not working with subfolders #4797

Closed
1 task done
so-grimm opened this issue Dec 11, 2023 · 5 comments · Fixed by #4875
Closed
1 task done

BUG: Login As (user impersonation) not working with subfolders #4797

so-grimm opened this issue Dec 11, 2023 · 5 comments · Fixed by #4875
Assignees

Comments

@so-grimm
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When working in a Neos installation in a subfolder, the user impersonation functionality doesn't work and I get an error saying "Could not switch to the selected user." In Neos installations without subfolder, it's working fine.

Expected Behavior

It should always be possible to switch users, regardless of using subfolders or not.

Steps To Reproduce

  1. use a Neos installation in a subfolder (e.g. www.myproject.com/subfolder/neos)
  2. go to User Management
  3. click on the crossed arrows at the very end of the table row for any user

Environment

- Flow: 8.0 (?)
- Neos: 8.0
- PHP:

Anything else?

No response

@so-grimm so-grimm added the Bug label Dec 11, 2023
@dlubitz dlubitz added the 8.0 label Dec 11, 2023
@dlubitz
Copy link
Contributor

dlubitz commented Dec 11, 2023

@so-grimm
Copy link
Contributor Author

Yeah, it is. There was a PR to fix this (sorry, forgot to add that in the report), but it was never merged: https://github.com/Unikka/login-as/pull/16/files
But I'm not quite happy with that fix and I think there has to be a better one. I'll look into it as soon as I have the time, but I figured it would be a good idea to create an issue for it already, so I don't forget (and in case someone else wants to fix it).

@kitsunet
Copy link
Member

Given that this script is included in pretty much all backend modules I guess we have to generate the correct url in the generic Module/Index.html template in Neos.Neos and then grab it from the markup in this script.

@so-grimm
Copy link
Contributor Author

So far I haven't encountered any problems with other backend modules, though 🤔 I can do some more testing, but everything else seems to be working fine.

@markusguenther markusguenther self-assigned this Dec 21, 2023
markusguenther added a commit that referenced this issue Feb 6, 2024
As described in the issue, the impersonation does not work when Neos is running in a subfolder. This change adds a data attribute with a dynamic URL to the DOM, and the user impersonation is using this module URL as base.

Fixes: #4797
@ahaeslich ahaeslich linked a pull request Feb 6, 2024 that will close this issue
6 tasks
@ahaeslich
Copy link
Member

So far I haven't encountered any problems with other backend modules, though 🤔 I can do some more testing, but everything else seems to be working fine.

Well there is another issue in the UI which is not that breaking: neos/neos-ui#3712

markusguenther added a commit to markusguenther/neos-ui that referenced this issue Feb 6, 2024
Addressing an issue where the redirection to /neos fails when Neos runs in a subfolder. This commit introduces a new route to the defaultModule. The index action of the backend controller is responsible for ensuring the correct backend module. Additionally, consideration for the preferredStartModules configuration has been incorporated here.

Fixes: neos/neos-development-collection#4797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants