Hi,
I think the one time login after creating new account and reset password should be ignored for redirection but they are being redirected and could not complete the 1st time password set/change.

Drupal Version: 8.8.2

I could see isApplicableOnCurrentPage() function to check the destination but this function didn't seem to be called while the actions.

By the way, what does "ALLOW DESTINATION" checkbox config do? I could not see any difference.

Thanks.

Comments

jvi created an issue. See original summary.

rithesh bk’s picture

Assigned: Unassigned » rithesh bk
Issue tags: +VbContribution2020

currently working on it ......

dhirendra.mishra’s picture

Let me work on this

dhirendra.mishra’s picture

Assigned: dhirendra.mishra » Unassigned
Status: Needs work » Needs review
StatusFileSize
new725 bytes

pls review the patch.

antonnavi’s picture

Status: Needs review » Needs work

Hello all here!

Thank you for help, Dhiren Mishra (dhirendra.mishra) !

Move added logic into service file plz https://git.drupalcode.org/project/login_redirect_per_role/blob/8.x-1.x/...
All working logic should be located inside of service.

jvi’s picture

Hi,

Thanks for the work and the patch but I'm still having same problem.
After create new account, received welcome message, accessed to one-time login link and pressed login,
still redirected destination was shown.

I checked if the patch file was successfully applied or not and I can see added few lines ($request = .... if ($request !=...).

I used drupal_set_message($request) to see the contents of $request. The below is the $request of my case.

POST /user/reset/8/1582160692/O6ajEtQi3zzPWRpA1XmfqoDeNbCVPEbvHuPQHJ5kTZA/login HTTP/1.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 Cache-Control: max-age=0 Connection: keep-alive Content-Length: 96 Content-Type: application/x-www-form-urlencoded Cookie: SESS49960de5880e8c687434170f6476605b=Nnx9r9MCdSLrJ0pBI9fbn2rMbiasb9rXkDbUCnBCiOc Expose: 80:80,8025:8025 Host: localhost:32123 Origin: http://localhost:32123 Referer: http://localhost:32123/user/reset/8 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: same-origin Sec-Fetch-User: ?1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36 X-Php-Ob-Level: 1 Cookie: SESS49960de5880e8c687434170f6476605b=Nnx9r9MCdSLrJ0pBI9fbn2rMbiasb9rXkDbUCnBCiOc form_build_id=form-6AEfPnYQ_SIsbAQTCk40JSFr_3eNpVX3-76TfNZ-91s&form_id=user_pass_reset&op=Log+in

Am I doing something wrong?
I also double checked by disabling the redirection and got proper password setting page after the one-time login.

I'm creating a new website with ddev drupal-composer environment (docker). Could this environment cause this problem?

Regards,

  • Antonnavi committed e1937e3 on 8.x-1.x
    Issue #3113915 by dhirendra.mishra, jvi, Rithesh BK: One time login for...
antonnavi’s picture

Module 8.x-1.x (DEV) branch was updated.
jvi could you test this issue (using 8.x-1.x module version) once again plz.

antonnavi’s picture

Version: 8.x-1.5 » 8.x-1.x-dev
Status: Needs work » Needs review
jvi’s picture

Hi Antonnavi,

Tried and confirmed it's working correctly with 8.x-1.x-dev version.
The redirection after one-time login was ignored and I could set the password.
Thanks a lot.

By the way, what does "ALLOW DESTINATION" checkbox config do? I could not see any difference.

Regards,

antonnavi’s picture

By the way, what does "ALLOW DESTINATION" checkbox config do? I could not see any difference.

When "Allow destination" checkbox is checked module checks if current page already has "destination" (GET parameter like: http://site.url/some-page?destination=/node/10) user will be redirected to it (in case from example redirect to /node/10 page instead of URL that was set on module configuration page).

antonnavi’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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