]> git.openstreetmap.org Git - rails.git/blob - config/initializers/omniauth_oauth2.rb
Add frozen_string_literal comments to ruby files
[rails.git] / config / initializers / omniauth_oauth2.rb
1 # frozen_string_literal: true
2
3 module OpenStreetMap
4   module OmniAuth
5     module Strategies
6       module OAuth2
7         def callback_phase
8           if request.request_method == "POST"
9             query = URI.encode_www_form(request.params)
10             uri = URI::Generic.build(:path => callback_path, :query => query)
11
12             session.options[:skip] = true
13
14             [303, { "Location" => uri.to_s }, []]
15           else
16             super
17           end
18         end
19       end
20     end
21   end
22 end
23
24 OmniAuth::Strategies::OAuth2.prepend(OpenStreetMap::OmniAuth::Strategies::OAuth2)