Use root URL as default signup redirect

When reload_on_success is set, use '/' as the fallback redirect URL instead of the current page (window.location.href). This prevents redirecting back to the signup page after a successful signup while preserving any explicit options.redirect_url value.
This commit is contained in:
jelveh
2026-04-05 16:59:25 -07:00
parent 2dd991700e
commit f867519a1c
+1 -1
View File
@@ -343,7 +343,7 @@ function UIWindowSignup (options) {
if ( options.reload_on_success ) {
window.onbeforeunload = null;
// either options.redirect_url or the current page
const redirectUrl = options.redirect_url || window.location.href;
const redirectUrl = options.redirect_url || '/';
window.location.replace(redirectUrl);
} else if ( options.send_confirmation_code || data.user?.requires_email_confirmation ) {
$(el_window).close();