From 3107a9410c0f73d65ec901fef4d6dfb973bc1b49 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 31 Oct 2023 07:10:15 -0400 Subject: [PATCH] Silence deprecation warning about secrets/credentials with Devise patch (#27578) --- config/initializers/devise.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 41d0ee25b7..2c6099623d 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,6 +2,15 @@ require 'devise/strategies/authenticatable' +# TODO: Remove this patch when this PR or similar is merged into Devise: +# https://github.com/heartcombo/devise/pull/5645 +# We rely on ENV vars and not secrets/credentials, so the deprecation is just noise. +class Devise::SecretKeyFinder + def find + @application.secret_key_base + end +end + Warden::Manager.after_set_user except: :fetch do |user, warden| session_id = warden.cookies.signed['_session_id'] || warden.raw_session['auth_id'] session_id = user.activate_session(warden.request) unless user.session_activations.active?(session_id)