Advanced Log-In & Sign-Up Flow ❺
Redirect users anywhere you want, after login
LOCALIZATION - If you are using Webflow's new localization features, there may be impacts with this library. Most notably, selecting an alternate locale, and then logging in likely will not detect and preserve that alternate locale. Let us know in the forum if you encounter any conflicts, we'd like to see sites operating with this configuration.
Overview
The sign-up and log-in flow in Memberships BETA currently has a couple of limitations.
As of Jan-2023, you can;
Perform a directed login, which redirects to the originally requested resource after login.
Redirect an undirected login to any static page on your site, including utility pages like the User Accounts page.
There are a few things you might want to do that you cannot do natively yet;
Redirect an undirected login to a Collection Item page.
Redirect an undirected login to a page, including query string params.
Handle a user's first login after sign-up specially, by redirecting them to a New User page.
Demonstration
Important Update
Jan-2023 - Webflow has enhanced the Login Redirect Fallback feature.
Usage Notes
This library is not attributes based, but rather has routing configuration options in its setup.
There are currently two configuration options;
routeAfterLogin
- specifies an optional path to redirect users after an explicit login.Recognizes a special path of
.
, which means, return to the current page.
routeAfterFirstLogin
- specifies an optional path for the first time a user logs in.
Getting Started ( LOCODE )
STEP 1 - Add the Library
First, add the library as detailed in Quick Start.
STEP 2 - Add your Configuration Callback
Add this script right after the library in your site-wide before HEAD custom code.
<!-- Sygnal Attributes 5 | Memberships | Config -->
<script>
window.sa5 = window.sa5 || [];
window.sa5.push(['getMembershipRoutingConfig',
(config) => {
config.routeAfterFirstLogin = '/u/new';
config.routeAfterLogin = '/u/home';
return config;
}]);
</script>
Configure the routing options to paths you prefer. In the example above, we've used /u/new
and /u/home
. Replace these with the URLs you want. If you do not want a special first-login route, you can remove that line.
See notes above.
Last updated
Was this helpful?