This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jomsky
jomsky

Anyone got this working?

I'm using my own view instead of the Account component but I use its methods. After registration I redirect the user to the login page where a flash message saying that the activation email has been sent.

This has been working great, but I can't display the Resend Activation Link/Activation Check HTML because it requires that the user is logged in. Furthermore, the onSendActivationEmail() method requires a $user object. And since the user hasn't been logged in because they have not activated their account yet this is not present in the view/component:


{% if user and not user.is_activated %}
        <h3>Your email address has not yet been verified.</h3>
        <p>
            You should verify your account otherwise it may be deleted. Please check your email to verify.
            <a href="nojavascript...;" data-request="onSendActivationEmail">Send the verification email again</a>.
        </p>

    {% endif %}`

Last updated

mjauvin
mjauvin

I think the idea is that a non-activated user can still login, but if activation is required, it will not be allowed access to the secured pages. At that point, you can show the link to re-send the activation email since the user object will exist in the view.

jomsky
jomsky

Thank you. That was the solution. For anyone else that will need this info you will also need to disable Require Activation in User Settings. Otherwise you won't be able to login the user.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.