I was able to make Rack::Session::DataMapper, Padrino and Omniauth work together. The main goal was to have the same sessions and users in the main app and in the admin section, and to have very long lasting sessions. Option set :sessions
was disabled, so I patched /padrino-core-0.9.23/lib\padrino-core/application.rb:203
use Rack::Flash if flash?
to not require sessions?
. Also I patched /padrino-admin-0.9.23/lib/padrino-admin/access_control.rb:15
to not enable sessions.
Here is my app code:
/admin/app.rb:
set :session_id, 'superapp.pro'.to_sym
use Rack::Session::DataMapper
/app/app.rb:
set :session_id, 'superapp.pro'.to_sym
use Rack::Session::DataMapper
/lib/omniauth_init.rb:
use Rack::Session::DataMapper
Question is: is there a nicer way to befriend custom rack session store with Omniauth? I'm not comfortable with using Rack::Session::DataMapper
three times.