Context.redirect after successful authentication

Hi all!

I’m a PLC programmer trying to do things I normally don’t do… so I’m a bit confused :smiley:

I’m testing Auth0 against a SCADA solution where I’m trying to redirect users to a different URL after a successful log in.

I created a rule to start testing. It works somewhat, but sends the user to Testproject without being authenticated. Pressing login in the SCADA system just loops it back. Off course…?

If I disable the rule, log in and then try to open the project its OK. Im then thinking, do I need a IF? Or something ?

function (user, context, callback) {
var project = “Testprosjekt”;
context.redirect = {
url: “” + project
return callback(null, user, context);

My main goal was to pull user role and use that in variable project. In this example the user would need role = Testprosjekt.

I appreciate all the help I can get. :slight_smile: :relaxed:


Anyone, please? :relaxed: