Skip to content

Commit

Permalink
Use secure remember_me cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
hulloitskai committed Jan 4, 2025
1 parent 8e6100a commit 0cbed46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 3 additions & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@

# Options to be passed to the created cookie. For instance, you can set
# secure: true in order to force SSL only cookies.
# config.rememberable_options = {}
config.rememberable_options = {
secure: Rails.env.production?,
}

# ==> Configuration for :validatable
# Range for password length.
Expand Down
9 changes: 1 addition & 8 deletions config/initializers/warden.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: strict
# typed: true
# frozen_string_literal: true

Warden::Manager.after_set_user do |user|
Expand All @@ -9,11 +9,4 @@
level: "info",
)
Sentry.add_breadcrumb(crumb)
# scope = opts.fetch(:scope)
# auth.cookies.signed["#{scope}.id"] = user.id
end

# Warden::Manager.before_logout do |_, auth, opts|
# scope = opts.fetch(:scope)
# auth.cookies.signed["#{scope}.id"] = nil
# end

0 comments on commit 0cbed46

Please sign in to comment.