I have a custom library in lib that handles remote authentication to our external auth system via soap. All works well from the controller. However, I feel all this logic should be moved to the model but I dont know how to invoke a method in a library Module from a model. Is this possible? Last resort is to move this logic into the controller, but that just seems to break MVC
Authentication generally isn't a domain responsibility. Thus, I
wouldn't put something like that in a model. Also, the authentication
logic itself probably doesn't belong in the controller. Rather, the
controller can invoke a method on the lib to authenticate the user. If
this is what you're doing already, what's bothering you about it?
I guess more because I am used to the authenticate methods being in the model with restful_authentication , etc.
Currently using a lib file loaded into a controller and calling a method from there, so I guess we are OK. Felt strange for some reason.