I checked this module, seems fine, thx. But my site needs to support external path as a login form url. Actually an external page does the login then redirects back to the original site. But, the problem is in the destination url parameter: now it is a relative url (node/xx) but for an external login page I needed a full path there as destination (http://mysi.te/node/xx).

It would be nice this module can add a support for external login form url.

Comments

denes.szabo’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

I made a patch with this feature, attached.

  • cc0e873 committed on 7.x-1.x
    Issue #1831780 Fix destination for external url login form
    
lotyrin’s picture

Issue summary: View changes
Status: Needs review » Fixed
lotyrin’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Fixed » Patch (to be ported)

Actually, 8.x branch was opened, lets make sure this lands there.

jkamizato’s picture

Guys,

follow the patch for Drupal 8.
I implemented the hook_user_login the redirect aflter login.

jkamizato’s picture

Status: Patch (to be ported) » Needs review
jkamizato’s picture

StatusFileSize
new0 bytes

Fixed patch

jkamizato’s picture

StatusFileSize
new1.41 KB

Correct file

jkamizato’s picture

StatusFileSize
new533 bytes

The new version.

From 8.x-1.x

jkamizato’s picture

New version.
Esse class not found fixed

jkamizato’s picture

jkamizato’s picture

StatusFileSize
new704 bytes

Version more clean

Fidelix’s picture

Status: Needs review » Needs work

I reviewed the patch and here are some improvements you could do if this method goes through:

+  $destination = \Drupal::request()->getQueryString();
+  parse_str($destination, $output);

parse_str will fail on null values, and that's a perfectly valid return value for getQueryString().
You could use \Drupal::request()->get() or \Drupal::request()->query->get() instead as it's easier to handle and always works.

This way of solving this problem is also weird, seems like a partial fix on top of a partial fix.
You should probably be solving this on r4032login_redirect() - which apparently is not doing what it's supposed to.

Most likely because the code was not re-evaluated during the D8 port.

jkamizato’s picture

StatusFileSize
new2.25 KB

@fidelix

I changed the way of resolving this. Now, in the onKernelException method, I verify if its possible to convert the destination from absolute to relative

jkamizato’s picture

Status: Needs work » Needs review

  • Nixou committed 9ed1663 on 8.x-1.x authored by jkamizato
    Issue #1831780 by jkamizato, nixou: Add support for external url as the...
nixou’s picture

Status: Needs review » Fixed

Since the patch was actually obsolete (edited 2 years ago), I rewrote it to match the current code.

It's now committed so the module support now external url.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.