Skip Navigation

[Resolved] Can't redirect after login

This support ticket is created 2 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jamal 2 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#2098991

I am creating a user flow for the registration of new participants and the creation of a participant profile. The participant profiles are proxy posts. I'm trying to implement a simplified version of this instruction: https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/

The user flow should be:
1) register as WP user > redirect to welcome & login page
2) user login > redirect to profile creation page
3) create user profile (= proxy post)

ad 1)
The URL is hidden link . The page contains the shortcode [cred_user_form form="deelnemers-aanmelden"]. The form redirects visitors after submission to the welcolme and login page hidden link. This works fine. WP users are created and redirection works

ad 2)
The generatied URL is hidden link. This page contains this shortcode for the login form: [wpv-login-form redirect_url="hidden link"] (following this documentation: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-login-form). Login works fine, but the redirection not. Instead, users are redirected to the home page.

ad 3)
The URL is hidden link. This page contains a form to create the user profile (=proxy post). When visited manually, the form works fine, a user profile is created indeed. But the user doesn't get there.

At first, my guess was it had to do with access rights (I'm using Access), but as far as I can judge the rights are fine.

Any clue what could be wrong, and how I could fix this? Feel free to try follow the user flow yourself. The content is draft anyhow.

Thanks in advance,

Joost

#2099963

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Joost and thank you for contacting Toolset support.

I would also suspect Access rules interfering with this, otherwise, it could be a custom code added in the theme or from a 3rd party plugin. I'll suggest performing a compatibility test, please check if this happens when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.

If this does not help find out the cause of this redirect, allow me temporary access to your website to check the whole workflow. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2100119

Thanks Jamal for your response and the confirmation of my suspicion. I proceeded on your suggestions.

I turns out that the culprit is the plugin 'Login or Logout Menu Item'. It switches a menu item between login and logout, depending on the user login status. As a matter of fact, I got a pointer to this plugin from another users ticket on this site. You might internally verify whether you leave that pointer.

I don't know the exact mechanics of this plugin, but obviously it interacts with the login procedure, and therefor with the access rights. Perhaps it's a timing issue, that the redirection takes place just before the user is actually logged in. That would explain why I have no issue to access the redirection page manually.

Do you have another suggestion how to build a similar switching functionality? For instance, how it works on the Toolset.com site is great: a login item if I'm not logged in and a dropdown menu if I'm logged in. I assume you built your own website with your own tooling 😉 So, (how) can I build that with Toolset?

#2100149

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Honestly, I don't know how the menu is implemented on our website. But, I do know that is not built using Toolset. Toolset does not have any effects on WordPress menus.

The menu can be built through different means:
- On the theme's code. I especially mean the header.php file.
- It can be done using custom code. Like this solution https://wordpress.stackexchange.com/a/156261
- Or using a 3rd party plugin. Maybe you can try a different plugin such as https://wordpress.org/plugins/login-logout-menu/ or https://wordpress.org/plugins/if-menu/

The only case where Toolset can be relevant is the 2nd one, by adding the snippet to Toolset->Settings->Custom code. Otherwise, Toolset cannot help at all. It is just out of the scope of its features.

I hope this helps. Let me know if you have any questions.

#2101943

Hi Jamal,

Thanls for your reply. I did some further research and testing. I realise I could build this functionality with some PHP. In the end, I settled for another plugin, 'Login Logout Register Menu' (by Vinod Dalvi). It has a similar functionality as the one I used, but without bug in the interaction with Toolset. Perhaps this is of use to other users.

I have another question that may or may not be related to this issue. In the instruction that I referred to above, it is suggested to have a two step implementation of some pages, e.g. the login page.
1) create a template, using the login form
2) create a login page, using the template
Why such an indirect approach? Is there a need for that? Is this considered to be best practice? Why not build the login page directly, as there is typically little need to re-use a login template for other pages?

#2102145

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for sharing your solution.

I am sorry, but I don't understand what do you mean. Is it about our documentation? Can you specify where?
Could you please elaborate a little more on your question so I can better understand it?

In the meantime, I would agree with your last words. You can directly create a page and put the login form inside of it without having to use a content template.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.