Member Sign-up / Login page redirect

Is there a way once someone signs up or logs in they get redirected to a specific page (like a members homepage) other than the websites home page?

1 Like

There isn’t a way to redirect them that I know of (but it might be possible with Velo), but I do know that you can have elements on the site that will only appear for members.

Hi!

There is actually a way to do this, using Velo.

To do this, you need to use the onLogin() api. It is called when the user logs in, and you can add code here to redirect to another page using wixLocation.to() .

Not that you’ll want to put this code on the master page (so it runs on all pages)

Alex

This worked like a charm. This is the exact code I used to make that happen. Thanks so much!

$w . onReady ( function () {
import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;

wixUsers . onLogin (( user ) => {
wixLocation . to ( "your site link here " );

});

2 Likes

Yes! I found a way to do it. I posted the code above if you were looking to do the same.

1 Like

Amazing!!

I have this exact same issue on a very, very basic site I am trying out an idea - but I cannot get the above code to work. The code is installed on all pages:

$w . onReady ( function () {
import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;

wixUsers . onLogin (( user ) => {

wixLocation . to ( "https://nicormerod.wixsite.com/member-form-test/account/blank-2" ); 

});

Any input would be greatly received.

@nicormerod Hi, remove the import lines out of on ready. Like this:

import wixUsers from ‘wixusers’ ;
import wixLocation from ‘wix-location’ ;

$w . onReady ( function ( {

wixUsers . onLogin (( user )={ wixLocation . to ( “https://nicormerod.wixsite.com/member-form-test/account/blank-2” );
});
});

I tried using the code above and got this error:

public/pages/masterPage.js: Unexpected token, expected “,” (7:24).
What should I do?

For those who looks to a more advanced and fully customizable Login-System with a tons of soon comming features…

Take a look here to the current developement-status of the mentioned Login-System.

Perhaps you will need one of the functionalities given in the shown example…

ATTENTION! This project is still under developement. → Not everything will work as expected.

https://russian-dima.wixsite.com/login-system/vnloginmgm

Especialy the asked/required functionality/feature, mentioned in this post will be integrated in this Login-System, as like as many others to.

You have some new ideas, what could be implemented into such a customizable Login-System?

Just contact me and tell me your thoguhts. You will also find me in the Velo-Forum. Every Feedback is welcome.

See you soon with an official Version :wink: