Welcome Guest, Not a member yet? Register   Sign In
A tutorial about Ion Auth and authentication in CI3

(10-29-2015, 08:27 PM)orionstar Wrote:
(10-29-2015, 04:14 PM)solidcodes Wrote: @Avenirer
that's sad it's really easy to organize MVC in HMVC.

It's very easy to use Ion Auth with HMVC. You create a module e.g. "users", you put Ion Auth into that folder. When you want to load Ion auth you load the library from the module: $this->load->library('users/ion_auth'); Then you replace the redirects in Ion Auth controller with a starting 'users/' (for example: redirect('users/login')), then rewrite every load in the Ion_auth.php libary file and in the model... also you should replace the form_open occurancies to start with 'users/'. Then you're done!

Your authentication should not be part of a module. Modules are, or should be, independent pieces of structured code. Making it part of a module means any other module, controller, library or model where authentication is required would be depended on the User module.
Keep it as a regular CI library. If you know how to work with Ion Auth the difference between using it in a regular controller or a MX_controller is minimal.

Messages In This Thread
RE: A tutorial about Ion Auth and authentication in CI3 - by Martin7483 - 10-30-2015, 02:07 AM

Theme © iAndrew 2016 - Forum software by © MyBB