Module: Oauth2Provider::Document::Base

Included in:
Client, Scope
Defined in:
app/models/oauth2_provider/document.rb

Instance Method Summary collapse

Instance Method Details

#base_uri(request) ⇒ Object



5
6
7
8
9
10
11
# File 'app/models/oauth2_provider/document.rb', line 5

def base_uri(request)
  protocol = request.protocol
  host = request.host_with_port
  name = self.class.name.underscore.pluralize.split('/').last
  id   = self.id.as_json
  uri  = protocol + host + "/oauth/" + name + "/" +  id
end