Problem/Motivation

$this->getRequest()->query->set('destination', $this->getRequest()->request->get('destination')); does nothing, let's remove it
Also we're doing some dancing around generating a URL, but in fact we can just use ->setRedirectUrl($account->toUrl())

Steps to reproduce

Proposed resolution

Remove the else clause
Change setRedirect to use ->setRedirectUrl($account->toUrl())

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3340128

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Issue summary: View changes

Gauravvv made their first commit to this issue’s fork.

royalpinto007’s picture

Assigned: Unassigned » royalpinto007
Status: Active » Needs work

gauravvvv’s picture

Status: Needs work » Needs review
mglaman’s picture

This looks like it handles redirects set by DefaultExceptionHtmlSubscriber

See \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::makeSubrequest

      // Add to query (GET) or request (POST) parameters:
      // - 'destination' (to ensure e.g. the login form in a 403 response
      //   redirects to the original URL)
      // - '_exception_statuscode'
      $parameters = $sub_request->isMethod('GET') ? $sub_request->query : $sub_request->request;
      $parameters->add($this->redirectDestination->getAsArray() + ['_exception_statuscode' => $status_code]);

This adds destination into the request parameter bag.

The big red flag is the fact tests didn't fail! Which means this is not tested.

larowlan’s picture

If this fails we can close this as works as designed, thanks @mglaman.

If it passes, we can re-purpose it to add new tests.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

CI failures in MR.

royalpinto007’s picture

Assigned: royalpinto007 » Unassigned
akram khan’s picture

StatusFileSize
new2.31 KB
new3.92 KB

added updated patch and Fixed CI failure

amanshukla6158’s picture

StatusFileSize
new1.77 KB

added another patch, resolving some coding standard issues as well.

amanshukla6158’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 13: 3340128-13.patch, failed testing. View results

larowlan’s picture

Status: Needs work » Closed (works as designed)

The test failures indicate this is expected functionality per comments from @mglaman and that we already have coverage

This works as designed.