lib/rodauth/oauth.rb in rodauth-oauth-1.6.2 vs lib/rodauth/oauth.rb in rodauth-oauth-1.6.3
- old
+ new
@@ -4,12 +4,12 @@
require "rodauth/oauth/version"
module Rodauth
module OAuth
module FeatureExtensions
- def auth_server_route(*args, &blk)
- routes = route(*args, &blk)
+ def auth_server_route(name, *args, &blk)
+ routes = route(name, *args, &blk)
handle_meth = routes.last
define_method(:"#{handle_meth}_for_auth_server") do
next unless is_authorization_server?
@@ -17,9 +17,12 @@
send(:"#{handle_meth}_not_for_auth_server")
end
alias_method :"#{handle_meth}_not_for_auth_server", handle_meth
alias_method handle_meth, :"#{handle_meth}_for_auth_server"
+
+ # make all requests usable via internal_request feature
+ internal_request_method name
end
# override
def translatable_method(meth, value)
define_method(meth) { |*args| translate(meth, value, *args) }