hensei-api/config/initializers/doorkeeper.rb
Justin Edmund e539bb16b6 Disable Doorkeeper's new client authentication for passwords
This will be removed eventually but figuring this out is not where I'm mentally at right now
2021-10-28 10:49:07 -07:00

22 lines
No EOL
801 B
Ruby

Doorkeeper.configure do
# Change the ORM that doorkeeper will use (needs plugins)
orm :active_record
# Issue access tokens with refresh token (disabled by default)
use_refresh_token
# Access token expiration time (default 2 hours).
# If you want to disable expiration, set this to nil.
access_token_expires_in 1.month
# This block will be called to authenticate the resource owner.
resource_owner_from_credentials do |routes|
User.find_by(email: params[:email]).try(:authenticate, params[:password])
end
# Specify what grant flows are enabled in array of Strings. The valid
# strings and the flows they enable are:
grant_flows %w(authorization_code client_credentials password)
skip_client_authentication_for_password_grant true
end