I have user privacy rules enabled and also have a status field that reflects whether the user is “Enabeled” or “Disabled”.
I can’t seem to find a way to restrict a “Disabled” user from logging into the system. I would want to do a check and see if the user logging in is disabled and then not allow them to actually log in.
What I am trying to avoid is having them log in, in order for me to do the User status check and then having to force them back out.
In your workflow, have a step before the “log the user in” step to show an alert or popup. Add an only-when condition that searches for the user (Based on the email provided) and if the status field = disabled.
On your login page, on the same workflow that logs the user in, you’ll want to set the “Only when” on that “Log the user in” action to “Current User’s Disabled = No”. This will block the user from logging in.
Then you can set up other actions like an alert letting them know it’s disabled using the same “Only when” expression.
Use this api and pass data values when user click the login button. it will pass the values and check the backendworkflow. Finally you will get return data from api. If it is invalid show error as your wish. otherwise allow your login action to proceed further.
If return from api is “No” then show error message and terminate the workflow, otherwise allow to login the user.
Note : This method can work if you are applied privacy rules.
Unfortunately I can’t seem to be able to search and get any results showing the status of the user prior to login. Can you share an example if you have one?
mani2726 - I was only able to make it work in ‘development’.
I noticed that the API URL was pointing to /version-test/.
I was hoping that by adding another call to the API and pointing it to the “Live” URL, would allow me to also get it to work in live. Unfortunately it did not work. How can I have it work both in development and live?