Redirect after registration does not work

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

zenimagine created an issue. See original summary.

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

zenimagine’s picture

Very good thanks, so this is a known issue ?

prem suthar’s picture

StatusFileSize
new185.3 KB
new343.51 KB

i Have tried this but i cant reproduce the issue for me its working
For the drupal 11 and i have installed composer require 'drupal/login_destination:2.x-dev@dev' this version of module.
i have attached image for the configuration of the redirect for register user.
also for the register user settings.

Please share the step to reproduce

zenimagine’s picture

StatusFileSize
new145.91 KB

I am on version 8.x-2.0-beta8 which is more recent than the dev version

sayan_k_dutta’s picture

The issue arises when the new account created needs to be validated through email or by admin. Seems like the redirection checking is bypassed if the user is not logged in. I am using version 2.x-dev@dev on drupal 10.3.10.

prem suthar’s picture

@sayan_k_dutta If user validation is required through email or admin approval, direct user redirection is not feasible. This is because the process involves sending a one-time login link, which is used for the first login to set the password. In this scenario, redirection cannot be implemented directly.

prem suthar’s picture

@zenimagine 8.x-2.0-beta8 in this version result is same.

sayan_k_dutta’s picture

Some specific case arise:

  1. User registers for a new account but is pending approval from admin.
  2. User registers for a new account but has not yet validated their email.
  3. User registers for a new account but both admin approval and email validation is pending.

In these cases the user is still not logged in. So just after creating the account, will they be redirected to the set page?
Need others' thoughts.

sayan_k_dutta’s picture

@prem suthar, thanks for the follow up, then I think the module works as designed.

zenimagine’s picture

This is not the expected behavior. When the user registers (with admin approval), he is immediately redirected to the homepage of the website with an alert, indicating that instructions have been sent to him by email.

I don't want to show him the homepage, but /node/38

Can the module display something other than the homepage?

sayan_k_dutta’s picture

We then have to modify the .module file to make the necessary changes. I am looking into it.

sayan_k_dutta’s picture

@zenimagine, I have created MR !24 with the changes. Please check if it works.

sayan_k_dutta’s picture

Status: Active » Needs review
sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
zenimagine’s picture

Great, I just tested it and it works. I only tested with accounts that need administrator approval.

lavanyatalwar’s picture

StatusFileSize
new1.24 MB
new1.16 MB

I just checked the functionality, and it looks good to me.
I am attaching screen recordings of the before and after states of applying the MR.
Moving it to RTBC.

lavanyatalwar’s picture

Status: Needs review » Reviewed & tested by the community

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

  • rsvelko committed 0524d2b7 on 8.x-2.x authored by sayan_k_dutta
    Issue #3497615 by sayan_k_dutta, prem suthar, lavanyatalwar, zenimagine...
rsvelko’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all. Fixed just now.
Releasing 8.x-2.0-beta9 for those who want to upgrade from release, and not use the module from a git clone.

sayan_k_dutta’s picture

Hey @rsvelko !
Thank you for merging the MR and addressing the issue. However, it looks like the credit hasn't been assigned yet. Could you please take a moment to assign it? Thanks again!

Status: Fixed » Closed (fixed)

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