1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-25 03:58:16 +09:00
mastodon/app/lib/oauth_pre_authorization_extension.rb

14 lines
332 B
Ruby
Raw Normal View History

2024-07-26 17:53:10 +09:00
# frozen_string_literal: true
module OauthPreAuthorizationExtension
extend ActiveSupport::Concern
included do
validate :code_challenge_method_s256, error: Doorkeeper::Errors::InvalidCodeChallengeMethod
end
def validate_code_challenge_method_s256
code_challenge.blank? || code_challenge_method == 'S256'
end
end