I am trying to detect if user is logged in and redirect if they are but i am facing a strange issue which is hard to explain.
I added the Security Identity to the SA and want to make a Condition which outputs ‘200 Success’ to trigger a Dynamic Event to redirect.
I get the output in console, code 200 and the TEXT but event in not triggered. and the ‘he’ Value is not outputted on the page. This is a test step which i know i don’t need but helps with debuging.
If i disable the Condition. the value of ‘he’ is outputted to the page. I don’t understand this.
If i reverse the condition and set a response 403(or whatever), if user IS logged in it finishes the action, sends 200 (on its own) and Dynamic event is triggered.
A response step overrides every other output in the server action.
You can bind the text part of response to contain any variables you want in output. But the kind of data that can be added is limited.
For your case, you can just not do anything in the “true” step. Just put in a comment and keep the else as response. So if condition is true, you will see the set value in output, else 403.
Also, from a security perspective, you should not expose the logged in user’s ID on the client side. For 99% of the cases, its not required.
No, it’s not a bug.
The response is not a valid JSON and that is the problem.
If you want to use it with a server connect component then it should return valid json, try to return true , null or "some string" .