knock
knock copied to clipboard
Let's become Knock the devise for JWT API.
It would be amazing to become knock the new devise for JWT API.
Or at least we can understand here together how to handle the signup, the recovery user and password, confirm the user after email and some other devise features?
I'm doing this from scratch right now, using knock of course. It wouldn’t be terribly difficult, just a bit time consuming. I am just using devise user model attributes to figure out what is needed.
I'm open to people contributing documentation and guides that we could link to from the README.
My vision for knock is to keep it strictly focused on authentication and to keep it as simple as possible so anyone regardless of their skill level can wrap their head around how the gem works.
Devise is awesome and feature-rich. One of the downside of this is that some people may use it without trying to understand its underlying mechanism correctly which I believe is a terrible thing.
I even believe knock already does too many things that could already be better separated inside the gem itself. All the meta-programming needed to provide a method such as authenticate_user
could and should be totally separated from the actual authentication mechanism for example.
Maybe a good way to get the best of both world would be to have a set of composable gems for things like password recovery, registration, etc. (e.g. knock-registration
, ...)
If someone wanted to create those gems, it would be amazing and I would be more than happy to help and review!
Beatiful. I agree with you 100%. I can't wait.
Hi all, I gave this a try. There are still a lot of rough edges and a lot of functionality that's missing, but if anyone is interested in contributing or just has ideas, I would be very happy to hear them!
Originally I was going to break everything out into separate gems, but I decided instead to do very basic email auth and try to make it very easy to extend. Here is the repo. I'm going to keep working through the roadmap at the bottom of the Readme, but if you have any other ideas for features/functionality, or better tests, please let me know.
@nsarno if you have some time to review it would be really great to hear your opinion of the implementation. I'm also a little stuck on how to bring the knock config out of the engine and let the user app set the initializer variables. If I understand the load order, these are loaded before the engine (and user app) so I'm not sure how the user can "reach back" to change them from their initializers.
One last note: I haven't been coding that long and I've never made a gem before so I'm sure there is a lot of low hanging fruit with regard to fixes. If you see something that strikes you as wrong, I wouldn't assume that I had a specific reason for doing it. Please do open an issue even if you don't have time for a PR.