There appears to be a bug whereby if a user registers, they are logged in straight away and not prompted to accept the terms until their next login.
Can anyone advise?
Is there something in the DNN issues?
As a workaround:
Options 1 - Put a statement on the login page that registration is acceptance of the terms and conditions.
Options 2: - Redirect after registration to a private page that only registred users can see. On the page put some JS that logs the user out by removing the auth cookie. That will force the login to be displayed and the user will have to login again, forcing the terms and conditions acceptence.. Then after login redirect to the "home" or other page.
Having thought about it for 2 more seconds, you should NOT login the user after registration?
The best way to do this is have validated registration. To be honest I can't think of any website we have that has public registration, we alway verify and I suggest you do unless it doesn't match the business requirments, but then you shoudl do something about fake/robot registrations. This is probably the reason the is not seen as a bug.
Another option is to customise the registration:
here is aChaGPT answer on that:
Disable Auto-Login via Customization
By default, DNN logs in users immediately after registration (in Public mode). To override that:
Approach: Customize or override the registration flow: Extend Register.ascx (or the MVC equivalent in newer versions)
Remove or comment out the login call:
UserController.UserLogin(...)
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.