Should I call check_active_accounts for each configuration #298
-
I've got two configurations here, main and admin. I'm checking active sessions in both but I worry that's inefficient or unnecessary: Is this what I'm supposed to be doing? And if so, does it require two DB queries per request, or will it only be one? Thanks class RodauthApp < Rodauth::Rails::App
configure RodauthMain
configure RodauthAdmin, :admin
route do |r|
rodauth.check_active_session
rodauth(:admin).check_active_session
r.rodauth
r.rodauth(:admin)
end
end |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need both calls if the main and admin configurations differ in |
Beta Was this translation helpful? Give feedback.
You need both calls if the main and admin configurations differ in
session_key_prefix
or account record retrieval (different tables or distinct table subsets). If your main and admin configurations share the session and table dataset, then it might not be technically necessary, but IMO it's still more correct to have both.