Skip Navigation

[Resolved] Redirect to this URL on success ERROR with Login form

This thread is resolved. Here is a description of the problem and solution.

Problem:
Redirect to this URL on success ERROR with Login form

Solution:
When you use [wpv-login-form] shortcode - the attribute "redirect_url" need "An absolute URL". A perfect domain name.

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/redirect-to-this-url-on-success-error-with-login-form/#post-924655

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form

This support ticket is created 6 years, 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Minesh 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#924341
Error1.JPG

Hi,

I guess there is a bug when inserting the 'Login Form' from Fields and Views. When I enter the home page address 'localhost/scivpro' in 'Redirect to this URL on success' I get an error message: 'Please enter a valid URL' . I am testing the website on XAMPP. What shall I enter in that field?

#924500

Hi, the following code fixes the problem (added in my_plugin.php):

function my_login_redirect( $redirect_to, $request, $user ) {
               return home_url('/my-account/');
   
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

It would be good to know if what I described above is a bug or not.

#924655

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I think you close the ticket in hurry. I would like to update you that this is not a bug and the validation error you see is expected as the URL you entered is not correct URL. If you will add localhost.com it will work.

If you check arguments for the [wpv-login-form] shortcode - it clearly mentioned that redirect_url attribute will need "An absolute URL". A perfect domain name.

If redirect_url attribute is set, visitors will be redirected to the specified URL. The URL used must be an absolute URL within the same website or within the allowed redirect hosts.

For example:

[wpv-login-form redirect_url="<em><u>hidden link</u></em>" allow_remember="true" remember_default="true"]

More info:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-login-form