In the User Registration Flow, let's suppose you want;
- User clicks the invitation in the email
- User completes the Registration form
- User logs in
- User is redirected to a special page for newly-registered Users
In this flow, STEP 4 is currently a different behavior from Webflow's new user signup flow.
But yes, you can do it.
Solution
The solution is to add a script to your login page, which checks the previous page that the user was just on, using;
document.referrer
If the document referrer was the /sign-up page, then we know the user has just completed signup, and this is their very first login.
Therefore, immediately, before they login, we redirect to the members-only page we want them to end up at.
Because it's a members-only page, and they have not logged in yet, you will be returned to the login page however with a special querystring.
For example, if we tried to redirect them to the User Account page, you would now see a login page query string of;
/log-in?usredir=%2Fuser-account
Now, if the user successfully completes the login, they will be immediately redirected to the User Account page.
Triggered from this discussion.
Check it out!
This site uses this approach.
- Sign Up for a free Members account.
- Check your email for the verification message Webflow sends
- Click the link, to be verified
On this first login, you'll be immediately redirected to a New User Welcome page. This happens only once. On future logins, you'll be taken to the Members-Only Home Page.