Bundle of corrections and one doorkeeper writing role change
This commit is contained in:
@@ -20,7 +20,7 @@ development:
|
||||
encoding: unicode
|
||||
slave2:
|
||||
adapter: postgresql
|
||||
url: <%= ENV['DB_SLAVE1_URL'] %>
|
||||
url: <%= ENV['DB_SLAVE2_URL'] %>
|
||||
pool: <%= ENV['DB_POOL'] %>
|
||||
timeout: 5000
|
||||
encoding: unicode
|
||||
@@ -69,4 +69,4 @@ production:
|
||||
pool: <%= ENV['DB_POOL'] %>
|
||||
timeout: 5000
|
||||
encoding: unicode
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ Doorkeeper.configure do
|
||||
end
|
||||
|
||||
resource_owner_from_credentials do |_routes|
|
||||
user = User.find_by(email: request.params[:username])
|
||||
user if !user&.otp_required_for_login? && user&.valid_password?(request.params[:password])
|
||||
ActiveRecord::Base.connected_to(role: :writing) do
|
||||
user = User.find_by(email: request.params[:username])
|
||||
user if !user&.otp_required_for_login? && user&.valid_password?(request.params[:password])
|
||||
end
|
||||
end
|
||||
|
||||
# If you want to restrict access to the web interface for adding oauth authorized applications, you need to declare the block below.
|
||||
|
||||
Reference in New Issue
Block a user