Silence deprecation warning about secrets/credentials with Devise patch (#27578)

pull/27631/head
Matt Jankowski 2023-10-31 07:10:15 -04:00 committed by GitHub
parent b264318431
commit 3107a9410c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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)