Auto Action to redirect after login when meeting certain conditions

2 months 2 weeks ago #307039 by haasdijk
I have made an auto action to send users who meet a certain condition (terms not yet accepted) to the tab of his profile where [acceptedterms] is located.
This is what i did:
trigger: onLoginAuthentication
type: redirect
user: automatic
access: everybody
condition: [acceptedterms] does not contain 1
parameters: none

After the login attempt the reroute takes place but this happens without completing the login, so a message appears that user has to login. I enabled debug mode to see if any error occurs but no.

What can I do about it
2 months 2 weeks ago #307044 by krileon
You're interrupting the login process as onLoginAuthentication happens during the authentication of their login credentials. Set User to Self and use the onAfterUserLoginSuccess trigger to perform actions at the absolute end of a frontend login process.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
2 months 2 weeks ago #307048 by haasdijk
Thanks Kyle,
The onAfterUserLoginSuccess trigger with the user set to self does not fire. I tested it with a redirect and the condition user_id contains 980 (the user_id of de user that logs in).
2 months 2 weeks ago #307054 by krileon

I tested it with a redirect and the condition user_id contains 980

Your substitution is missing brackets causing a string comparison to 980 which is always false. Example as follows.

[user_id] Equal To 980


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Moderators: beatnantkrileon
Time to create page: 0.382 seconds
Facebook Twitter Google LinkedIn