we have defined user group specific pages after signin in the standard app settings.
Additionally, we want to email in some scenarios magic deep links to our users which lead them to other pages than the standard pages after signin which we have defined for the different user groups.
Problem: The “magic link&next-page=/page-path” does not work anymore, i.e. all these magic links+next page URLs get redirected to the standard user-group specific page which we have defined as standard after signin.
Can you post an example link that uses the next-page querystring parameter that is not working? I am wondering if perhaps you’re using a & when you need to be using a ? in the URL.
@alexs thanks for sharing. I think this was conflicting with global redirect rules on user group level. We had an update 10 mins ago and I think this should be addressed. BTW would suggest DM-ing the magic links and not putting publicly here.
I want to redirect to a specific page and pass 2 parameters the record ID and the people ID, because these 2 fields are used to prefill a fillout form embed in the page.
Issue is that when it resolves the magic token, it redirect to the page but only keeps the first parameter
second is removed
Any idea on this ? Thanks in advance for your time
Thanks @Suzie, this is really awesome. Solve the case, as always ! Thank you Softr team.
I share the piece of custom code in case someone else need this.
This was implemented as a “Run a script” task in an airtable automation.
Make sure to well declare your variables first to make it works. Enjoy
function customEncode(text) {
return encodeURIComponent(text).replace(/%20/g, "+").replace(/%21/g, "!").replace(/%22/g, "\"").replace(/%23/g, "#").replace(/%24/g, "$").replace(/%26/g, "&").replace(/%27/g, "'").replace(/%28/g, "(").replace(/%29/g, ")").replace(/%2A/g, "*").replace(/%2B/g, "+");
}
let varliste = input.config();
console.log(varliste);
let magiclink = varliste.magiclink[0];
console.log(magiclink);
let pageurl = varliste.actionpageurl;
console.log(pageurl);
let rid = varliste.projectrecordid[0];
console.log(rid);
let peopleid = varliste.peopleID[0];
console.log(peopleid);
const redirecturl = pageurl + “?recordId=” + rid+ "&peopleId=" +peopleid;
var encodedURL = customEncode(redirecturl);
console.log(encodedURL);
const url = magiclink + "/&next-page=%2F" + encodedURL
console.log(url);
output.set('url', url);