Forum Discussion

Han's avatar
Han
Ace
7 years ago

Capture successful Log in and Registration

Hi all, I would like to capture a successful log in and user registration.  Ideally I am looking for some kind of variable that after the forms were submitted I could know if the process was compl...
  • luk's avatar
    7 years ago

    Han You could give the "activity" context object a try: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=freemarker#l::{"p":"%2Frefer%2FcontextObjects","h":"%23activity"}

    It should allow you to "catch" registration events. Not sure what you define as "successful", if you mean that user.registration.complete == true, then I do not think that would happen immediately, as the user usually needs to confirm the email for that..., but some exemplary code might help anyways...

    <#if (!user.registration.complete)>
        <#-- do something if user didn't confirm email yet -->
    <#elseif (user.registered && user.registration.complete)>
        <#-- this one seems to be successfully registered -->
    <#elseif (user.anonymous)>
        <#-- this one is not logged in -->
    </#if>