Role based redirects problem

Hi there,

Thank you for your reply. However, that didn’t work.
It seems that it redirects me to the home regardless of the role with your example.

As to the function, it is an identity-signup.js stored at netlify/functions folder:

  exports.handler = function(event, context, callback) {
  const data = JSON.parse(event.body);
  const { user } = data;
  
 const responseBody = {
 app_metadata: {
    roles: ["user"],
    my_user_info: "Invited site visitor"
  },
  user_metadata: {
    ...user.user_metadata, // append current user metadata
    custom_data_from_function: "Automatically added to user group on sign-up."
  }
};
callback(null, {
  statusCode: 200,
  body: JSON.stringify(responseBody)
 });
};

This one has proven to be working, I have tested it with a couple of users already.

I can’t believe that the redirect conditions do not support the NOT logic. But I couldn’t find any example of how to do this. I have also contacted the support, but it seems I will grow a beard earlier than they get to reply.

P.S. I think the redirects do not work because the first rule in the file for the same url counts as the priority. At least they mentioned this in the docs.