Hey there, I'm developing a gem that brings easy GitHub authentication to rails.
It is called
warden-github-rails and is built on top of
warden-github which in turn is built on top of warden.
I've encountered some difficulties when using it in a rails app that also uses devise.
The problems I encountered which made it impossible to use my gem side by side with devise are:
- Both gems add a Warden::Manager middleware which causes only the first instance to exist in a request.
- Devise monkey patches Warden::SessionSerializer#serialize and #deserialize breaking the original user storage.
For (1), I've looked into hooking into the already defined middlewares and extend the existing Warden::Manager block to add my own warden configs.
This clearly isn't very nice and relies on accessing instance variables in Railties.
For (2), I'm not really sure what can be done. I saw that warden checks for a #{scope}_serialize and #{scope}_deserialize and call those if present, otherwise it call #serialize and #deserialize.
Now, I wanted to ask if it would be possible to circumvent these problems somehow or if it would be thinkable to add support to devise to be able to run side by side with other gems on top of warden.
Cheers,
Philipe