MasqueradeBlock & getRedirectResponse improvements

Created on 10 July 2020, almost 5 years ago
Updated 18 January 2023, over 2 years ago

Problem/Motivation
a) When clicking masquerade in the block, the block will often redirect me to the front page. Which it shouldn't. It should allow me to stay on the current page even if the masqueraded user has no permission to see whats on the current page. It's very uncomfortable to always switch back.

b) Also when I'm masqueraded as a user that has no access to the admin toolbar I can't unmasquerade. Therefore I have to logoff and login again.

Proposed resolution
a) Check whether the referer in the header is set, if so redirect me to it. If not only then redirect me to the front page.

b) If I'm currently masqueraded use the MasqueradeBlock to show a unmasquerade button.

Remaining tasks
Review patches.
a) 3158235-get-redirect-response-improvements.patch
b) 3158235-masquerade-block-improvements.patch

User interface changes
Add a unmasquerade button.

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇩🇪Germany eugen zerr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇩🇰Denmark ressa Copenhagen

    I agree, staying on the same page, and not redirecting to the front page (for example if you click "Masquerade as User" at /user/5) would be a nice improvement.

    I think part b) in the Issue Summary is no longer relevant, since "Unmasquerade" is shown both in the Admin Toolbar, but also in the user account block.

    b) Also when I'm masqueraded as a user that has no access to the admin toolbar I can't unmasquerade. Therefore I have to logoff and login again.

    I am adding an MR based on the patch from #4 in the hopes that it can restart this issue, since it would make the module even better, thanks!

  • Merge request !23Add MR based on patch from #4 → (Open) created by ressa
  • Pipeline finished with Failed
    2 months ago
    Total: 1931s
    #487599
  • Pipeline finished with Failed
    2 months ago
    Total: 186s
    #487616
  • Pipeline finished with Failed
    2 months ago
    Total: 351s
    #487620
  • Pipeline finished with Failed
    2 months ago
    Total: 242s
    #487630
  • 🇩🇰Denmark ressa Copenhagen

    The test errors look like false positives, see 🐛 Drupal 12 environment requirements are not yet defined, don't use Drupal 10 requirements Active .

  • Pipeline finished with Success
    2 months ago
    Total: 195s
    #487666
Production build 0.71.5 2024