Permalink
Browse files

Serialize user ID, not the entire user object.

  • Loading branch information...
dblock committed Jul 8, 2018
1 parent 8382006 commit 0c3c4dea50b1d0eff4af27b9f540d129f78dbcaa
Showing with 8 additions and 0 deletions.
  1. +8 −0 config/initializers/warden.rb
@@ -1,3 +1,11 @@
Rails.application.config.middleware.insert_after Rack::ETag, Warden::Manager do |manager|
manager.failure_app = GraphqlController

Warden::Manager.serialize_into_session do |user|
user.id
end

Warden::Manager.serialize_from_session do |id|
User.find(id)
end
end

0 comments on commit 0c3c4de

Please sign in to comment.