smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 225 forks source link

Decoupling controller functionality #324

Open sashman opened 6 years ago

sashman commented 6 years ago

Hey,

I'm very interested in coherence and the functionality it provides, however, I'd like to experiment with combining its functionality with other frameworks, for example ueberauth, or just in the case where I would like to use my customer controllers.

I have noticed that a lot of the meat is inside the coherence controllers, for example in order to fully create a new session you require to use Coherence.SessionController.create/2. Would it be a good idea to separate this functionality into a separate module so it could be used outside of coherence?

If this seems sensible I could start with a PR to pull out session functionality? I'm not 100% sure what the *_service.ex modules are intended for, but this would be a place I'd refactor the functionality to.

How does this sound?

smpallen99 commented 6 years ago

I know I'm late on responding to this. I would be interested in a discussion around what you see.

I'm not a fan of the Service abstraction I was using for a while. Perhaps something else though.

You may want to do a quick proof of concept on 1 controller for something to discuss.

There is a change I would like to make to the generated controllers. Instead of a complete copy of the Coherence controllers, I would like to have them use a module that injects the actions with def overrides. This way, updating coherence may be a lot easier...

Perhaps there may be a good marriage of these two ideas.