0
0
Fork 0

Merge upstream

This commit is contained in:
무라쿠모 2024-10-04 22:41:58 +09:00
commit 8477922587
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
288 changed files with 3268 additions and 1457 deletions

View file

@ -9,16 +9,9 @@ Doorkeeper.configure do
current_user || redirect_to(new_user_session_url)
end
resource_owner_from_credentials do |_routes|
user = User.authenticate_with_ldap(email: request.params[:username], password: request.params[:password]) if Devise.ldap_authentication
user ||= User.authenticate_with_pam(email: request.params[:username], password: request.params[:password]) if Devise.pam_authentication
if user.nil?
user = User.find_by(email: request.params[:username])
user = nil unless user&.valid_password?(request.params[:password])
end
user unless user&.otp_required_for_login?
# Disable Resource Owner Password Credentials Grant Flow
resource_owner_from_credentials do
nil
end
# Doorkeeper provides some administrative interfaces for managing OAuth
@ -169,7 +162,7 @@ Doorkeeper.configure do
# http://tools.ietf.org/html/rfc6819#section-4.4.3
#
grant_flows %w(authorization_code password client_credentials)
grant_flows %w(authorization_code client_credentials)
# Under some circumstances you might want to have applications auto-approved,
# so that the user skips the authorization step.

View file

@ -1,4 +0,0 @@
# frozen_string_literal: true
# 2s is a fairly high default, but that should account for slow servers under load
Regexp.timeout = ENV.fetch('REGEXP_TIMEOUT', 2).to_f if Regexp.respond_to?(:timeout=)