]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/oauth_controller.rb
Bump osm-community-index from 5.6.1 to 5.6.2
[rails.git] / app / controllers / oauth_controller.rb
index babd27c536ffd4eaf4d813e2fce559678a2fbadc..cd7e48277a2517b23e49af4cdb31eddfd396a762 100644 (file)
@@ -27,7 +27,7 @@ class OauthController < ApplicationController
     any_auth = false
 
     @token.client_application.permissions.each do |pref|
     any_auth = false
 
     @token.client_application.permissions.each do |pref|
-      if params[pref]
+      if params[pref].to_i.nonzero?
         @token.write_attribute(pref, true)
         any_auth ||= true
       else
         @token.write_attribute(pref, true)
         any_auth ||= true
       else
@@ -66,7 +66,7 @@ class OauthController < ApplicationController
 
           @redirect_url.query += "&oauth_verifier=#{@token.verifier}" unless @token.oauth10?
 
 
           @redirect_url.query += "&oauth_verifier=#{@token.verifier}" unless @token.oauth10?
 
-          redirect_to @redirect_url.to_s
+          redirect_to @redirect_url.to_s, :allow_other_host => true
         end
       else
         @token.invalidate!
         end
       else
         @token.invalidate!