module Rodauth::OAuth::FeatureExtensions

  1. lib/rodauth/oauth.rb

Methods

Public Instance

  1. auth_server_route
  2. translatable_method

Public Instance methods

auth_server_route(name, *args, &blk)
[show source]
   # File lib/rodauth/oauth.rb
 9 def auth_server_route(name, *args, &blk)
10   routes = route(name, *args, &blk)
11 
12   handle_meth = routes.last
13 
14   define_method(:"#{handle_meth}_for_auth_server") do
15     next unless is_authorization_server?
16 
17     send(:"#{handle_meth}_not_for_auth_server")
18   end
19 
20   alias_method :"#{handle_meth}_not_for_auth_server", handle_meth
21   alias_method handle_meth, :"#{handle_meth}_for_auth_server"
22 
23   # make all requests usable via internal_request feature
24   internal_request_method name
25 end
translatable_method(meth, value)

override

[show source]
   # File lib/rodauth/oauth.rb
28 def translatable_method(meth, value)
29   define_method(meth) { |*args| translate(meth, value, *args) }
30   auth_value_methods(meth)
31 end